diff --git a/builds/respec-aom.js b/builds/respec-aom.js index a8edc385a3..91821162f6 100644 --- a/builds/respec-aom.js +++ b/builds/respec-aom.js @@ -1,5 +1,5 @@ -window.respecVersion="32.8.0",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(f.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&i.done]))[0]};return _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,A=/[\u000A\u000D\u0009\u0020]/u,L=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&L.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const O=/[&<>"']/,D=new RegExp(O.source,"g"),I=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,P=new RegExp(I.source,"g"),j={"&":"&","<":"<",">":">",'"':""","'":"'"},z=e=>j[e];function M(e,t){if(t){if(O.test(e))return e.replace(D,z)}else if(I.test(e))return e.replace(P,z);return e}const q=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function F(e){return e.replace(q,((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 B=/(^|[^\[])\^/g;function H(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(B,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const W=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(e,t,n){if(e){let e;try{e=decodeURIComponent(F(n)).replace(W,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!U.test(n)&&(n=function(e,t){Z[" "+e]||(G.test(e)?Z[" "+e]=e+"/":Z[" "+e]=ee(e,"/",!0));const n=-1===(e=Z[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(K,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Z={},G=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;const Q={exec:function(){}};function X(e){let t,n,r=1;for(;r{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function re(e,t,n,r){const o=t.href,i=t.title?M(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:M(s)}}class oe{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ee(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ee(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=c.slice(i),i+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(s=0;s"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:J(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n({text:e})));for(s=e.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):M(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=ee(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),re(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return re(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=M(e,!0),{type:"codespan",raw:t[0],text:e}}}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[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=M(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=M(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=M(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=M(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):M(n[0]):n[0]:M(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const ie={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Q,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ie.def=H(ie.def).replace("label",ie._label).replace("title",ie._title).getRegex(),ie.bullet=/(?:[*+-]|\d{1,9}[.)])/,ie.listItemStart=H(/^( *)(bull) */).replace("bull",ie.bullet).getRegex(),ie.list=H(ie.list).replace(/bull/g,ie.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ie.def.source+")").getRegex(),ie._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",ie._comment=/|$)/,ie.html=H(ie.html,"i").replace("comment",ie._comment).replace("tag",ie._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ie.paragraph=H(ie._paragraph).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ie._tag).getRegex(),ie.blockquote=H(ie.blockquote).replace("paragraph",ie.paragraph).getRegex(),ie.normal=X({},ie),ie.gfm=X({},ie.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ie.gfm.table=H(ie.gfm.table).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ie._tag).getRegex(),ie.gfm.paragraph=H(ie._paragraph).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ie.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ie._tag).getRegex(),ie.pedantic=X({},ie.normal,{html:H("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ie._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(ie.normal._paragraph).replace("hr",ie.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ie.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Q,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Q,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",se.punctuation=H(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,se.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,se._comment=H(ie._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),se.emStrong.lDelim=H(se.emStrong.lDelim).replace(/punct/g,se._punctuation).getRegex(),se.emStrong.rDelimAst=H(se.emStrong.rDelimAst,"g").replace(/punct/g,se._punctuation).getRegex(),se.emStrong.rDelimUnd=H(se.emStrong.rDelimUnd,"g").replace(/punct/g,se._punctuation).getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=H(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=H(se.tag).replace("comment",se._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=H(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=H(se.reflink).replace("label",se._label).replace("ref",ie._label).getRegex(),se.nolink=H(se.nolink).replace("ref",ie._label).getRegex(),se.reflinkSearch=H(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=X({},se),se.pedantic=X({},se.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:H(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=X({},se.normal,{escape:H(se.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+ne("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+ne("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,i.index+i[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,le))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,le))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,ae))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}let ue=class{constructor(e){this.options=e||N}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
'+(n?e:M(e,!0))+"
\n":"
"+(n?e:M(e,!0))+"
\n"}blockquote(e){return`
\n${e}
\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`${e}\n`}return`${e}\n`}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\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 n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+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,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r='",r}image(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`${n}":">",r}text(e){return e}};class de{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,n){return""+n}image(e,t,n){return""+n}br(){return""}}class pe{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class fe{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new de,this.slugger=new pe}static parse(e,t){return new fe(t).parse(e)}static parseInline(e,t){return new fe(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,b,y,w,v,x="";const k=e.length;for(n=0;n0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);x+=this.renderer.list(u,p,f);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&i()}))}),0))})),void(0===s&&i())}function r(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+M(e.message+"",!0)+"
    ";throw e}try{const n=ce.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(he.walkTokens(n,t.walkTokens)).then((()=>fe.parse(n,t))).catch(r);he.walkTokens(n,t.walkTokens)}return fe.parse(n,t)}catch(e){r(e)}}he.options=he.setOptions=function(e){var t;return X(he.defaults,e),t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n=X({},e);if(n.async=he.defaults.async||n.async,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new ue;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let i=e.renderer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new oe;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let i=e.tokenizer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.tokenizer=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");te(t=X({},he.defaults,t||{}));try{const n=ce.lexInline(e,t);return t.walkTokens&&he.walkTokens(n,t.walkTokens),fe.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+M(e.message+"",!0)+"
    ";throw e}},he.Parser=fe,he.parser=fe.parse,he.Renderer=ue,he.TextRenderer=de,he.Lexer=ce,he.lexer=ce.lex,he.Tokenizer=oe,he.Slugger=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline,fe.parse,ce.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return s(""===n?e[r-1]:n,o)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return l(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(o,r,e),p.isPlural=d(o,r,e),p.singular=u(r,o,t),p.isSingular=d(r,o,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var be=ge,ye=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=i.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,i){for(var s=("selectedIndex"in t),a=s;r>>0;ns;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,x=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(S),n=z("div");return n.innerHTML=''+e+"",j(t,n.firstChild.childNodes),t}:A)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,F,B,H,W,U,V,Z,G=(q="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(M=e),(U=M.createDocumentFragment())[q](M[B]("g")),U[q](M[B]("")),(W?M[H](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,s=0;n&&s

    ',V.content.childNodes[0].getAttribute(Z)==K)||(K="_dt: "+K.slice(1,-1)+";",Q=!0)}catch(u){}var X="\x3c!--"+K+"--\x3e",J=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+K+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=Q?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;ae.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Ee=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Se=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ae="en"===l||l.startsWith("en-")?"en-AU":l,Le=new Intl.DateTimeFormat(Ae,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ae?"2-digit":"numeric"});function Te(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Re(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Ne(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const Oe=Ne("conjunction"),De=Ne("disjunction");function Ie(e,t){return Oe(e,t).join("")}function Pe(e){return e.trim().replace(/\s+/g," ")}function je(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function ze(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){et(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function Me(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>we`${e}, `));return we`${r}${n[n.length-1]}`}function qe(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function Fe(e){const t=new Set,n="ltNodefault"in e.dataset?"":Pe(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>Pe(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(Pe(e))))}return[...t]}function Be(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function He(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function We(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Ue(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Ve(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Ze extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Ge(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Be(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ye(t),t}function Ye(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ke(t)])e.remove()}function*Ke(e){for(;e.nextNode();)yield e.currentNode}class Qe extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Xe extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||qe(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:s,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:s,details:a,stack:n}}}function Je(e,t,n={}){const o={...n,isWarning:!1};r("error",new Xe(e,t,o))}function et(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Xe(e,t,o))}function tt(e){return e?`\`${e}\``:""}function nt(e,{quotes:t}={quotes:!1}){return De(e,t?e=>{return tt((t=e,String(t)?`"${t}"`:""));var t}:tt).join("")}function rt(e,...t){return _e(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,i]=r.slice(1,-1).split("|");if(i){return`${e}[${o}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}const ot=new Map([["text/html","html"],["application/xml","xml"]]);function it(e,t=document){const n=ot.get(e);if(!n){const t=[...ot.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=st(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function st(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ye(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Re(o);const i=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&i.appendChild(s);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=we``);i.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=we` +window.respecVersion="32.8.1",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(f.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&i.done]))[0]};return _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,A=/[\u000A\u000D\u0009\u0020]/u,L=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&L.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const O=/[&<>"']/,D=new RegExp(O.source,"g"),I=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,P=new RegExp(I.source,"g"),z={"&":"&","<":"<",">":">",'"':""","'":"'"},j=e=>z[e];function M(e,t){if(t){if(O.test(e))return e.replace(D,j)}else if(I.test(e))return e.replace(P,j);return e}const q=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function F(e){return e.replace(q,((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 B=/(^|[^\[])\^/g;function H(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(B,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const W=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(e,t,n){if(e){let e;try{e=decodeURIComponent(F(n)).replace(W,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!U.test(n)&&(n=function(e,t){Z[" "+e]||(G.test(e)?Z[" "+e]=e+"/":Z[" "+e]=J(e,"/",!0));const n=-1===(e=Z[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(K,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Z={},G=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;const Q={exec:function(){}};function X(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,i=t.title?M(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:M(s)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:J(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=J(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=c.slice(i),i+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(s=0;s"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:X(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n({text:e})));for(s=e.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):M(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=J(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=M(e,!0),{type:"codespan",raw:t[0],text:e}}}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[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=M(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=M(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=M(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=M(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):M(n[0]):n[0]:M(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Q,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=H(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=H(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=H(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/|$)/,re.html=H(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=H(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=H(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic={...re.normal,html:H("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Q,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Q,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=H(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=H(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=H(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=H(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=H(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=H(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=H(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=H(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=H(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=H(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=H(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...oe.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:H(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:H(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,i.index+i[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,se))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,se))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,ie))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:M(e,!0))+"
    \n":"
    "+(n?e:M(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`${e}\n`}return`${e}\n`}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\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 n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+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,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`${n}":">",r}text(e){return e}};class ce{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,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ue{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,b,y,w,v,x="";const k=e.length;for(n=0;n0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);x+=this.renderer.list(u,p,f);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1{"function"==typeof r&&(o=r,r=null);const i={...r},s=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+M(r.message+"",!0)+"
    ";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...he.defaults,...i}).silent,r.async,o);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return s(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&he.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?s(e):o(null,n)};if(!i||i.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return he.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(he.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&he.walkTokens(o,r.walkTokens);let i=t(o,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return s(e)}}}function he(e,t,n){return fe(ae.lex,de.parse)(e,t,n)}he.options=he.setOptions=function(e){var t;return he.defaults={...he.defaults,...e},t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=he.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let i=e.renderer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let i=e.tokenizer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.tokenizer=t}if(e.hooks){const t=he.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(he.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,o);return r.call(t,i)}:t[n]=(...o)=>{let i=e.hooks[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.hooks=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=fe(ae.lexInline,de.parseInline),he.Parser=de,he.parser=de.parse,he.Renderer=le,he.TextRenderer=ce,he.Lexer=ae,he.lexer=ae.lex,he.Tokenizer=ne,he.Slugger=ue,he.Hooks=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return s(""===n?e[r-1]:n,o)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return l(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(o,r,e),p.isPlural=d(o,r,e),p.singular=u(r,o,t),p.isSingular=d(r,o,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var be=ge,ye=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=i.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,i){for(var s=("selectedIndex"in t),a=s;r>>0;ns;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,x=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=j(S),n=j("div");return n.innerHTML=''+e+"",z(t,n.firstChild.childNodes),t}:A)(e)});function z(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function j(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,F,B,H,W,U,V,Z,G=(q="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(M=e),(U=M.createDocumentFragment())[q](M[B]("g")),U[q](M[B]("")),(W?M[H](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,s=0;n&&s

    ',V.content.childNodes[0].getAttribute(Z)==K)||(K="_dt: "+K.slice(1,-1)+";",Q=!0)}catch(u){}var X="\x3c!--"+K+"--\x3e",J=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+K+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=Q?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;ae.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Ee=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Se=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ae="en"===l||l.startsWith("en-")?"en-AU":l,Le=new Intl.DateTimeFormat(Ae,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ae?"2-digit":"numeric"});function Te(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Re(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Ne(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const Oe=Ne("conjunction"),De=Ne("disjunction");function Ie(e,t){return Oe(e,t).join("")}function Pe(e){return e.trim().replace(/\s+/g," ")}function ze(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function je(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){et(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function Me(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>we`${e}, `));return we`${r}${n[n.length-1]}`}function qe(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function Fe(e){const t=new Set,n="ltNodefault"in e.dataset?"":Pe(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>Pe(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(Pe(e))))}return[...t]}function Be(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function He(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function We(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Ue(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Ve(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Ze extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Ge(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Be(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ye(t),t}function Ye(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ke(t)])e.remove()}function*Ke(e){for(;e.nextNode();)yield e.currentNode}class Qe extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Xe extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||qe(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:s,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:s,details:a,stack:n}}}function Je(e,t,n={}){const o={...n,isWarning:!1};r("error",new Xe(e,t,o))}function et(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Xe(e,t,o))}function tt(e){return e?`\`${e}\``:""}function nt(e,{quotes:t}={quotes:!1}){return De(e,t?e=>{return tt((t=e,String(t)?`"${t}"`:""));var t}:tt).join("")}function rt(e,...t){return _e(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,i]=r.slice(1,-1).split("|");if(i){return`${e}[${o}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}const ot=new Map([["text/html","html"],["application/xml","xml"]]);function it(e,t=document){const n=ot.get(e);if(!n){const t=[...ot.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=st(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function st(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ye(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Re(o);const i=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&i.appendChild(s);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=we``);i.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=we` `;i.appendChild(c),t.prepend(i),r("beforesave",o)}(n);let o="";if("xml"===e)o=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(o+=(new XMLSerializer).serializeToString(n.doctype)),o+=n.documentElement.outerHTML;return o}t("core/exporter",{rsDocToDataURL:it});class at{constructor(){this._respecDonePromise=new Promise((e=>{o("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],o("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),o("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return st("html",document)}}const lt="core/post-process";const ct="core/pre-process";const ut="core/base-runner";async function dt(e){!function(){const e=new at;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),o("amend-user-config",n),o("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),o=Object.fromEntries(n);Object.assign(e,o),r("amend-user-config",o)}(respecConfig),performance.mark(`${ut}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `preProcess` must be a JS function.",ct),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`preProcess\`.`,ct,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),respecConfig.state={},await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const i=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(i),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},r("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `postProcess` must be a JS function.",lt),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`postProcess\`.`,lt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Re(document),performance.mark(`${ut}-end`),performance.measure(ut,`${ut}-start`,`${ut}-end`)}var pt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} @@ -84,7 +84,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} `;let St,Ct;window.addEventListener("load",(()=>Ot(_t)));const At=[],Lt=[],Tt={};o("start-all",(()=>document.body.prepend($t)),{once:!0}),o("end-all",(()=>document.body.prepend($t)),{once:!0});const Rt=we``;function Nt(){_t.classList.toggle("respec-hidden"),_t.classList.toggle("respec-visible"),_t.hidden=!_t.hidden}function Ot(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}$t.appendChild(Rt),Rt.addEventListener("click",(e=>{e.stopPropagation(),Rt.setAttribute("aria-expanded",String(_t.hidden)),Nt(),_t.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{_t.hidden||Nt()})),$t.appendChild(_t),_t.addEventListener("keydown",(e=>{"Escape"!==e.key||_t.hidden||(Rt.setAttribute("aria-expanded",String(_t.hidden)),Nt(),Rt.focus())}));const Dt=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function It(e,t,n,r){t.push(e),Tt.hasOwnProperty(n)||(Tt[n]=function(e,t,n){const r=we``;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=we`
      `;for(const e of t){const t=document.createRange().createContextualFragment(jt(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),o.appendChild(n)}Pt.freshModal(n,o,r)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return kt(r,o),r}(n,t,r),$t.appendChild(Tt[n]));const o=Tt[n];o.textContent=t.length;const i=1===t.length?$e.singular(r):r;kt(o,new Map([["label",`${t.length} ${i}`]]))}kt(Rt,Dt);const Pt={show(){try{$t.hidden=!1}catch(e){console.error(e)}},hide(){$t.hidden=!0},enable(){Rt.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=we``;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=we`
        `;for(const e of t){const t=document.createRange().createContextualFragment(zt(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),o.appendChild(n)}Pt.freshModal(n,o,r)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return kt(r,o),r}(n,t,r),$t.appendChild(Tt[n]));const o=Tt[n];o.textContent=t.length;const i=1===t.length?$e.singular(r):r;kt(o,new Map([["label",`${t.length} ${i}`]]))}kt(Rt,Dt);const Pt={show(){try{$t.hidden=!1}catch(e){console.error(e)}},hide(){$t.hidden=!0},enable(){Rt.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=we``,s=we`
      1. ${i}
      2. `;return s.addEventListener("click",t),_t.appendChild(s),i},error(e){It(e,At,"error","ReSpec Errors")},warning(e){It(e,Lt,"warning","ReSpec Warnings")},closeModal(e){Ct&&(Ct.classList.remove("respec-show-overlay"),Ct.classList.add("respec-hide-overlay"),Ct.addEventListener("transitionend",(()=>{Ct.remove(),Ct=null}))),e&&e.setAttribute("aria-expanded","false"),St&&(St.remove(),St=null,Rt.focus())},freshModal(e,t,n){St&&St.remove(),Ct&&Ct.remove(),Ct=we`
        `;const r=`${n.id}-modal`,o=`${r}-heading`;St=we`
        ${e}
        ${t}
        -
        `;const i=new Map([["labelledby",o]]);kt(St,i),document.body.append(Ct,St),Ct.addEventListener("click",(()=>this.closeModal(n))),Ct.classList.toggle("respec-show-overlay"),St.hidden=!1,Ot(St)}};function jt(e){if("string"==typeof e)return e;const t=e.plugin?`

        (plugin: "${e.plugin}")

        `:"",n=e.hint?`\n${bt(`

        How to fix: ${_e(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`

        Occurred ${e.elements.length} times at:

        \n ${bt(e.elements.map(zt).join("\n"))}`:"",o=e.details?`\n\n
        \n${e.details}\n
        \n`:"";return`${bt(`**${e.message}**`,{inline:!0})}${n}${r}${o}${t}`}function zt(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function Mt(e){try{Pt.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await dt(e)}finally{Pt.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&Pt.closeModal()})),window.respecUI=Pt,o("error",(e=>Pt.error(e))),o("warn",(e=>Pt.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const qt=[Promise.resolve().then((function(){return Ft})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Ut})),Promise.resolve().then((function(){return Gt})),Promise.resolve().then((function(){return Qt})),Promise.resolve().then((function(){return sn})),Promise.resolve().then((function(){return xt})),Promise.resolve().then((function(){return Ee})),Promise.resolve().then((function(){return cn})),Promise.resolve().then((function(){return $n})),Promise.resolve().then((function(){return Sn})),Promise.resolve().then((function(){return Cn})),Promise.resolve().then((function(){return Tn})),Promise.resolve().then((function(){return Mr})),Promise.resolve().then((function(){return Hr})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return io})),Promise.resolve().then((function(){return uo})),Promise.resolve().then((function(){return go})),Promise.resolve().then((function(){return wo})),Promise.resolve().then((function(){return sr})),Promise.resolve().then((function(){return Mo})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return br})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return tn})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return Ko})),Promise.resolve().then((function(){return Xo})),Promise.resolve().then((function(){return ei})),Promise.resolve().then((function(){return ii})),Promise.resolve().then((function(){return di})),Promise.resolve().then((function(){return pi})),Promise.resolve().then((function(){return wi})),Promise.resolve().then((function(){return _i})),Promise.resolve().then((function(){return Ti})),Promise.resolve().then((function(){return Ni})),Promise.resolve().then((function(){return Di})),Promise.resolve().then((function(){return Bi})),Promise.resolve().then((function(){return Ui})),Promise.resolve().then((function(){return Qi})),Promise.resolve().then((function(){return es})),Promise.resolve().then((function(){return os})),Promise.resolve().then((function(){return ls})),Promise.resolve().then((function(){return ds})),Promise.resolve().then((function(){return hs})),Promise.resolve().then((function(){return bs})),Promise.resolve().then((function(){return vs}))];Promise.all(qt).then((e=>Mt(e))).catch((e=>console.error(e)));var Ft=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash=`#${e}`}))}});const Bt={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Ht=new Map([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),Wt={format:"markdown",logos:[{src:"https://aomedia.org/assets/images/aomedia-icon-only.png",alt:"AOM",id:"AOM",height:170,width:170,url:"https://aomedia.org/"}],license:"aom"};var Ut=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...Bt.lint,...Wt.lint,...e.lint};Object.assign(e,{...Bt,...Wt,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:Ht.get(e.license)}}(e))}});var Vt=String.raw`@keyframes pop{ + `;const i=new Map([["labelledby",o]]);kt(St,i),document.body.append(Ct,St),Ct.addEventListener("click",(()=>this.closeModal(n))),Ct.classList.toggle("respec-show-overlay"),St.hidden=!1,Ot(St)}};function zt(e){if("string"==typeof e)return e;const t=e.plugin?`

        (plugin: "${e.plugin}")

        `:"",n=e.hint?`\n${bt(`

        How to fix: ${_e(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`

        Occurred ${e.elements.length} times at:

        \n ${bt(e.elements.map(jt).join("\n"))}`:"",o=e.details?`\n\n
        \n${e.details}\n
        \n`:"";return`${bt(`**${e.message}**`,{inline:!0})}${n}${r}${o}${t}`}function jt(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function Mt(e){try{Pt.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await dt(e)}finally{Pt.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&Pt.closeModal()})),window.respecUI=Pt,o("error",(e=>Pt.error(e))),o("warn",(e=>Pt.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const qt=[Promise.resolve().then((function(){return Ft})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Ut})),Promise.resolve().then((function(){return Gt})),Promise.resolve().then((function(){return Qt})),Promise.resolve().then((function(){return sn})),Promise.resolve().then((function(){return xt})),Promise.resolve().then((function(){return Ee})),Promise.resolve().then((function(){return cn})),Promise.resolve().then((function(){return $n})),Promise.resolve().then((function(){return Sn})),Promise.resolve().then((function(){return Cn})),Promise.resolve().then((function(){return Tn})),Promise.resolve().then((function(){return Mr})),Promise.resolve().then((function(){return Hr})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return io})),Promise.resolve().then((function(){return uo})),Promise.resolve().then((function(){return go})),Promise.resolve().then((function(){return wo})),Promise.resolve().then((function(){return sr})),Promise.resolve().then((function(){return Mo})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return br})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return tn})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return Ko})),Promise.resolve().then((function(){return Xo})),Promise.resolve().then((function(){return ei})),Promise.resolve().then((function(){return ii})),Promise.resolve().then((function(){return di})),Promise.resolve().then((function(){return pi})),Promise.resolve().then((function(){return wi})),Promise.resolve().then((function(){return _i})),Promise.resolve().then((function(){return Ti})),Promise.resolve().then((function(){return Ni})),Promise.resolve().then((function(){return Di})),Promise.resolve().then((function(){return Bi})),Promise.resolve().then((function(){return Ui})),Promise.resolve().then((function(){return Qi})),Promise.resolve().then((function(){return es})),Promise.resolve().then((function(){return os})),Promise.resolve().then((function(){return ls})),Promise.resolve().then((function(){return ds})),Promise.resolve().then((function(){return hs})),Promise.resolve().then((function(){return bs})),Promise.resolve().then((function(){return vs}))];Promise.all(qt).then((e=>Mt(e))).catch((e=>console.error(e)));var Ft=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash=`#${e}`}))}});const Bt={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Ht=new Map([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),Wt={format:"markdown",logos:[{src:"https://aomedia.org/assets/images/aomedia-icon-only.png",alt:"AOM",id:"AOM",height:170,width:170,url:"https://aomedia.org/"}],license:"aom"};var Ut=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...Bt.lint,...Wt.lint,...e.lint};Object.assign(e,{...Bt,...Wt,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:Ht.get(e.license)}}(e))}});var Vt=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -150,7 +150,7 @@ dd{margin-left:0} } @media print{ .removeOnSave{display:none} -}`;const Zt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Vt,document.head.appendChild(e),e}();var Gt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Zt.remove()}});const Yt="aom/style";const Kt=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(Te))t.appendChild(n);return t}();Kt.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||Kt.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Kt);var Qt=Object.freeze({__proto__:null,name:Yt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",et(t,Yt)}let t="";if("PD"===e.specStatus.toUpperCase())t="W3C-UD";else t="base.css";e.noToc||o("end-all",(()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,n),o("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});class Xt{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Jt(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Jt(e){const t=new Xt(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function en(e){const t=Jt(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var tn=Object.freeze({__proto__:null,name:"core/sections",restructure:en,run:function(){en(document.body)}});const nn="core/data-include";function rn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=ze(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=bt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&en(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function on(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);rn(await o.text(),r,n),t<3&&await on(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Je(r,nn,{elements:[e]})}}));await Promise.all(r)}var sn=Object.freeze({__proto__:null,name:nn,run:async function(){await on(document,1)}});const an="core/title",ln=je({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var cn=Object.freeze({__proto__:null,name:an,run:function(e){const t=document.querySelector("h1#title")||we`

        `;if(t.isConnected&&""===t.textContent.trim()){Je('The document is missing a title, so using a default title. To fix this, please give your document a ``. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',an,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${ln.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=Pe(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=we` +}`;const Zt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Vt,document.head.appendChild(e),e}();var Gt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Zt.remove()}});const Yt="aom/style";const Kt=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(Te))t.appendChild(n);return t}();Kt.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||Kt.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Kt);var Qt=Object.freeze({__proto__:null,name:Yt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",et(t,Yt)}let t="";if("PD"===e.specStatus.toUpperCase())t="W3C-UD";else t="base.css";e.noToc||o("end-all",(()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,n),o("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});class Xt{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Jt(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Jt(e){const t=new Xt(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function en(e){const t=Jt(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var tn=Object.freeze({__proto__:null,name:"core/sections",restructure:en,run:function(){en(document.body)}});const nn="core/data-include";function rn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=je(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=bt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&en(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function on(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);rn(await o.text(),r,n),t<3&&await on(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Je(r,nn,{elements:[e]})}}));await Promise.all(r)}var sn=Object.freeze({__proto__:null,name:nn,run:async function(){await on(document,1)}});const an="core/title",ln=ze({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var cn=Object.freeze({__proto__:null,name:an,run:function(e){const t=document.querySelector("h1#title")||we`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Je('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',an,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${ln.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=Pe(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=we` Preview of PR <a href="${n}">#${e.prNumber}</a>: `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function un(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return et(t,"core/templates/show-link"),void console.warn(t,e)}return we` <dt class="${e.class?e.class:null}">${e.key}</dt> @@ -166,7 +166,7 @@ dd{margin-left:0} src="${e.src||null}" width="${e.width||null}" /> - </a>`;if(!e.alt){const r=rt`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Je(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,pn,{hint:r,elements:[n]})}if(!e.src){const e=rt`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Je(`Logo at index ${t} is missing "\`src\`" property.`,pn,{hint:e,elements:[n]})}return n}const hn="core/templates/show-people",mn=je({en:{until:e=>we` Until ${e} `},es:{until:e=>we` Hasta ${e} `},ko:{until:e=>we` ${e} 이전 `},ja:{until:e=>we` ${e} 以前 `},de:{until:e=>we` bis ${e} `},zh:{until:e=>we` 直到 ${e} `}});function gn(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,i=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Je(`${i} Missing required property \`"name"\`.`,hn,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${i} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Je(n,hn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Je(`${i} ORCID "${o}" has wrong format.`,hn,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=(12-e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0)%11)%11,r=10===n?"X":String(n);return t===r}(n))return Je(`${i} ORCID "${n}" failed checksum check.`,hn,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(s=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(s)?new Date(s):"Invalid Date").toString())?(Je(`${i} The property "\`retiredDate\`" is not a valid date.`,hn,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return Je(`${n}. Member "extra" at index ${r} is not an object.`,hn,{hint:t}),!1;case!e.hasOwnProperty("name"):return Je(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,hn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Je(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,hn,{hint:t}),!1}return!0})):(Je(`${n}. A person's "extras" member must be an array.`,hn,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&et(`${i} Has both "url" and "mailto" property.`,hn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&et(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,hn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var s});var o;return n.filter(r).map(bn)}function bn(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(we`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(we`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(we`<a class="p-name orcid" href="${e.orcid}">${we`<svg + </a>`;if(!e.alt){const r=rt`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Je(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,pn,{hint:r,elements:[n]})}if(!e.src){const e=rt`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Je(`Logo at index ${t} is missing "\`src\`" property.`,pn,{hint:e,elements:[n]})}return n}const hn="core/templates/show-people",mn=ze({en:{until:e=>we` Until ${e} `},es:{until:e=>we` Hasta ${e} `},ko:{until:e=>we` ${e} 이전 `},ja:{until:e=>we` ${e} 以前 `},de:{until:e=>we` bis ${e} `},zh:{until:e=>we` 直到 ${e} `}});function gn(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,i=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Je(`${i} Missing required property \`"name"\`.`,hn,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${i} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Je(n,hn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Je(`${i} ORCID "${o}" has wrong format.`,hn,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=(12-e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0)%11)%11,r=10===n?"X":String(n);return t===r}(n))return Je(`${i} ORCID "${n}" failed checksum check.`,hn,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(s=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(s)?new Date(s):"Invalid Date").toString())?(Je(`${i} The property "\`retiredDate\`" is not a valid date.`,hn,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return Je(`${n}. Member "extra" at index ${r} is not an object.`,hn,{hint:t}),!1;case!e.hasOwnProperty("name"):return Je(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,hn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Je(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,hn,{hint:t}),!1}return!0})):(Je(`${n}. A person's "extras" member must be an array.`,hn,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&et(`${i} Has both "url" and "mailto" property.`,hn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&et(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,hn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var s});var o;return n.filter(r).map(bn)}function bn(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(we`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(we`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(we`<a class="p-name orcid" href="${e.orcid}">${we`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" @@ -192,7 +192,7 @@ dd{margin-left:0} data-editor-id="${r}" > ${o} - </dd>`}const yn=je({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest approved version:",this_version:"This version:",issue_tracker:"Issue Tracker:"}});var wn=e=>we`<div class="head"> + </dd>`}const yn=ze({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest approved version:",this_version:"This version:",issue_tracker:"Issue Tracker:"}});var wn=e=>we`<div class="head"> ${"PD"!==e.specStatus?e.logos.map(fn):""} ${document.querySelector("h1#title")} ${function(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}(e)} <h2> @@ -245,7 +245,7 @@ dd{margin-left:0} DAMAGE. </p>`}(e)} <hr /> - </div>`;const vn="aom/headers",xn={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},kn=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var $n=Object.freeze({__proto__:null,name:vn,run:function(e){if(!e.specStatus){Je("Missing required configuration: `specStatus`",vn)}e.title=document.title||"No title",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Ce.format(r);return new Date(e)}return Je(`[\`${t}\`](https://github.com/w3c/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,vn),new Date(Ce.format(new Date))}(e,"publishDate",document.lastModified),e.thisVersion=`https://aomediacodec.github.io/${e.shortName}/`,e.issueTracker=`https://github.com/AOMediaCodec/${e.shortName}/issues/`,e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=kn.format(e.publishDate);const t=function(e){if(!e.name){Je("All authors and editors must have a name.",vn)}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}if(!e.editors||0===e.editors.length){Je("At least one editor is required",vn)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=xn[e.specStatus],e.dashDate=Ce.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=wn(e);document.body.prepend(n),document.body.classList.add("h-entry"),r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const _n="aom/abstract",En=je({en:{abstract:"Abstract"}});var Sn=Object.freeze({__proto__:null,name:_n,run:async function(){const e=document.getElementById("abstract");if(!e){return void Je('Document must have one element with `id="abstract"',_n)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=En.abstract,e.prepend(t))}});var Cn=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=ze(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const An="core/dfn-abbr";function Ln(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var Tn=Object.freeze({__proto__:null,name:An,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Ln(t);else{Je(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,An,{elements:[t],title:"Error: unsupported."})}}}});const Rn=/^[a-z]+(\s+[a-z]+)+\??$/,Nn=/\B"([^"]*)"\B/,On=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Dn=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,In=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Pn=/^(?:\w+)\??$/,jn=/^(\w+)\["([\w- ]*)"\]$/,zn=/\.?(\w+\(.*\)$)/,Mn=/\/(.+)/,qn=/\[\[.+\]\]/;function Fn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return we`<a + </div>`;const vn="aom/headers",xn={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},kn=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var $n=Object.freeze({__proto__:null,name:vn,run:function(e){if(!e.specStatus){Je("Missing required configuration: `specStatus`",vn)}e.title=document.title||"No title",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Ce.format(r);return new Date(e)}return Je(`[\`${t}\`](https://github.com/w3c/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,vn),new Date(Ce.format(new Date))}(e,"publishDate",document.lastModified),e.thisVersion=`https://aomediacodec.github.io/${e.shortName}/`,e.issueTracker=`https://github.com/AOMediaCodec/${e.shortName}/issues/`,e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=kn.format(e.publishDate);const t=function(e){if(!e.name){Je("All authors and editors must have a name.",vn)}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}if(!e.editors||0===e.editors.length){Je("At least one editor is required",vn)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=xn[e.specStatus],e.dashDate=Ce.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=wn(e);document.body.prepend(n),document.body.classList.add("h-entry"),r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const _n="aom/abstract",En=ze({en:{abstract:"Abstract"}});var Sn=Object.freeze({__proto__:null,name:_n,run:async function(){const e=document.getElementById("abstract");if(!e){return void Je('Document must have one element with `id="abstract"',_n)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=En.abstract,e.prepend(t))}});var Cn=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=je(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const An="core/dfn-abbr";function Ln(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var Tn=Object.freeze({__proto__:null,name:An,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Ln(t);else{Je(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,An,{elements:[t],title:"Error: unsupported."})}}}});const Rn=/^[a-z]+(\s+[a-z]+)+\??$/,Nn=/\B"([^"]*)"\B/,On=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Dn=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,In=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Pn=/^(?:\w+)\??$/,zn=/^(\w+)\["([\w- ]*)"\]$/,jn=/\.?(\w+\(.*\)$)/,Mn=/\/(.+)/,qn=/\[\[.+\]\]/;function Fn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return we`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" @@ -288,7 +288,7 @@ dd{margin-left:0} data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function Yn(e){let t;try{t=function(e){const t=qn.test(e),n=t?Mn:zn,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),s=!e.includes("/"),a=[];for(;i.length;){const t=i.pop();if(On.test(t)){const[,e,n,r,o]=t.match(On),i=n.split(/,\s*/).filter((e=>e)),l=r?.trim(),c=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:i,renderParent:s,renderText:l,renderArgs:c})}else if(jn.test(t)){const[,e,n]=t.match(jn);a.push({type:"enum",identifier:e,enumValue:n,renderParent:s})}else if(Nn.test(t)){const[,e]=t.match(Nn);s?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:s})}else if(Dn.test(t)){const[,e,n]=t.match(Dn),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:s})}else if(In.test(t)&&i.length){const[,e]=t.match(In);a.push({type:"attribute",identifier:e,renderParent:s})}else if(Rn.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:s,nullable:e})}else{if(!Pn.test(t)||0!==i.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:s,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=we`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Je(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=we(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Fn(e);t&&r.push(t);break}case"attribute":r.push(Wn(e));break;case"internal-slot":r.push(Bn(e));break;case"method":r.push(Un(e));break;case"enum":r.push(Vn(e));break;case"exception":r.push(Zn(e));break;case"idl-primitive":r.push(Gn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Kn=new Set(["alias","reference"]),Qn=async function(){const e=await ve.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map((t=>e.deleteObjectStore(t)));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...Kn]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let i=await r.openCursor(o);for(;i?.value;){const e=i.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),i=await i.continue()}}return e}();const Xn={get ready(){return Qn},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Kn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Kn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Kn].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Kn.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){if((await this.get(e,t.id))?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Kn],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},Jn={},er=new URL("https://api.specref.org/bibrefs?refs="),tr=Te({hint:"dns-prefetch",href:er.origin});let nr;document.head.appendChild(tr);const rr=new Promise((e=>{nr=e}));async function or(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(er.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),i=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),i):i;await Xn.addAll(o,e)}catch(e){console.error(e)}return o}async function ir(e){const t=await rr;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await ir(n.aliasOf):n}var sr=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Jn;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await Xn.ready;const n=e.map((async e=>({id:e,data:await Xn.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{Jn[e.id]=e.data}));const i=o.noData.map((e=>e.id));if(i.length){const e=await or(i,{forceUpdate:!0});Object.assign(Jn,e)}Object.assign(Jn,this.conf.localBiblio),(()=>{nr(this.conf.biblio)})()}},biblio:Jn,name:"core/biblio",resolveRef:ir,updateFromNetwork:or});const ar="core/render-biblio",lr=je({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"}}),cr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PER","W3C Proposed Edited Recommendation"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),ur=(dr=".",e=>{const t=e.trim();return!t||t.endsWith(dr)?t:t+dr});var dr;function pr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(fr)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),i=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),s=we`<section> + >`}function Yn(e){let t;try{t=function(e){const t=qn.test(e),n=t?Mn:jn,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),s=!e.includes("/"),a=[];for(;i.length;){const t=i.pop();if(On.test(t)){const[,e,n,r,o]=t.match(On),i=n.split(/,\s*/).filter((e=>e)),l=r?.trim(),c=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:i,renderParent:s,renderText:l,renderArgs:c})}else if(zn.test(t)){const[,e,n]=t.match(zn);a.push({type:"enum",identifier:e,enumValue:n,renderParent:s})}else if(Nn.test(t)){const[,e]=t.match(Nn);s?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:s})}else if(Dn.test(t)){const[,e,n]=t.match(Dn),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:s})}else if(In.test(t)&&i.length){const[,e]=t.match(In);a.push({type:"attribute",identifier:e,renderParent:s})}else if(Rn.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:s,nullable:e})}else{if(!Pn.test(t)||0!==i.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:s,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=we`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Je(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=we(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Fn(e);t&&r.push(t);break}case"attribute":r.push(Wn(e));break;case"internal-slot":r.push(Bn(e));break;case"method":r.push(Un(e));break;case"enum":r.push(Vn(e));break;case"exception":r.push(Zn(e));break;case"idl-primitive":r.push(Gn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Kn=new Set(["alias","reference"]),Qn=async function(){const e=await ve.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map((t=>e.deleteObjectStore(t)));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...Kn]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let i=await r.openCursor(o);for(;i?.value;){const e=i.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),i=await i.continue()}}return e}();const Xn={get ready(){return Qn},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Kn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Kn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Kn].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Kn.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){if((await this.get(e,t.id))?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Kn],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},Jn={},er=new URL("https://api.specref.org/bibrefs?refs="),tr=Te({hint:"dns-prefetch",href:er.origin});let nr;document.head.appendChild(tr);const rr=new Promise((e=>{nr=e}));async function or(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(er.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),i=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),i):i;await Xn.addAll(o,e)}catch(e){console.error(e)}return o}async function ir(e){const t=await rr;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await ir(n.aliasOf):n}var sr=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Jn;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await Xn.ready;const n=e.map((async e=>({id:e,data:await Xn.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{Jn[e.id]=e.data}));const i=o.noData.map((e=>e.id));if(i.length){const e=await or(i,{forceUpdate:!0});Object.assign(Jn,e)}Object.assign(Jn,this.conf.localBiblio),(()=>{nr(this.conf.biblio)})()}},biblio:Jn,name:"core/biblio",resolveRef:ir,updateFromNetwork:or});const ar="core/render-biblio",lr=ze({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"}}),cr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PER","W3C Proposed Edited Recommendation"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),ur=(dr=".",e=>{const t=e.trim();return!t||t.endsWith(dr)?t:t+dr});var dr;function pr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(fr)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),i=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),s=we`<section> <h3>${t}</h3> <dl class="bibliography">${i.map(mr)}</dl> </section>`;qe(s,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Je(`Reference "[${t}]" not found.`,ar,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),s}function fr(e){let t=Jn[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Je(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,ar)}else n=t.aliasOf,t=Jn[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function hr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=we`<cite @@ -300,7 +300,7 @@ dd{margin-left:0} >${lr.reference_not_found}</em >`} </dd> - `}function gr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${ur(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${cr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var br=Object.freeze({__proto__:null,name:ar,renderInlineCitation:hr,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||we`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(we`<h1>${lr.references}</h1>`),r.classList.add("appendix"),n.length){const e=pr(n,lr.norm_references);r.appendChild(e)}if(t.length){const e=pr(t,lr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const yr="core/inlines",wr={},vr=e=>new RegExp(e.map((e=>e.source)).join("|")),xr=je({en:{rfc2119Keywords:()=>vr([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY?\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>vr([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),kr=/(?:`[^`]+`)(?!`)/,$r=/(?:{{[^}]+\?*}})/,_r=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Er=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Sr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Cr=/(?:\[=[^=]+=\])/,Ar=/(?:\[\^[^^]+\^\])/;function Lr(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,s,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return we`<code + `}function gr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${ur(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${cr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var br=Object.freeze({__proto__:null,name:ar,renderInlineCitation:hr,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||we`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(we`<h1>${lr.references}</h1>`),r.classList.add("appendix"),n.length){const e=pr(n,lr.norm_references);r.appendChild(e)}if(t.length){const e=pr(t,lr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const yr="core/inlines",wr={},vr=e=>new RegExp(e.map((e=>e.source)).join("|")),xr=ze({en:{rfc2119Keywords:()=>vr([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY?\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>vr([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),kr=/(?:`[^`]+`)(?!`)/,$r=/(?:{{[^}]+\?*}})/,_r=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Er=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Sr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Cr=/(?:\[=[^=]+=\])/,Ar=/(?:\[\^[^^]+\^\])/;function Lr(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,s,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return we`<code ><a data-xref-type="${i}" data-xref-for="${s}" @@ -308,13 +308,13 @@ dd{margin-left:0} data-link-for="${s}" >${a}</a ></code - >`}function Tr(e){const t=Pe(e),n=we`<em class="rfc2119">${t}</em>`;return wr[t]=!0,n}function Rr(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?we`<a href="${t}" data-matched-text="${e}"></a>`:we`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Nr(e,t){const n=Pe(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Yn(n);return!!t.parentElement.closest("dfn")?jr(`\`${r.textContent}\``):r}function Or(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(Pe),{type:s,illegal:a}=He(o,t.parentElement),l=hr(o,i),c=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;et("Normative references in informative sections are not allowed. ",yr,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==s||a?n.normativeReferences.add(c):n.informativeReferences.add(c),l.childNodes[1]?l.childNodes:[l]}function Dr(e,t,n){return"ABBR"===t.parentElement.tagName?e:we`<abbr title="${n.get(e)}">${e}</abbr>`}function Ir(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return we`<var data-type="${r}">${n}</var>`}function Pr(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(Pe).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),i=n.substring(r+1,n.length);return[t(o),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],s=zr(i),a=n?Pe(n):null;return we`<a + >`}function Tr(e){const t=Pe(e),n=we`<em class="rfc2119">${t}</em>`;return wr[t]=!0,n}function Rr(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?we`<a href="${t}" data-matched-text="${e}"></a>`:we`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Nr(e,t){const n=Pe(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Yn(n);return!!t.parentElement.closest("dfn")?zr(`\`${r.textContent}\``):r}function Or(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(Pe),{type:s,illegal:a}=He(o,t.parentElement),l=hr(o,i),c=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;et("Normative references in informative sections are not allowed. ",yr,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==s||a?n.normativeReferences.add(c):n.informativeReferences.add(c),l.childNodes[1]?l.childNodes:[l]}function Dr(e,t,n){return"ABBR"===t.parentElement.tagName?e:we`<abbr title="${n.get(e)}">${e}</abbr>`}function Ir(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return we`<var data-type="${r}">${n}</var>`}function Pr(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(Pe).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),i=n.substring(r+1,n.length);return[t(o),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],s=jr(i),a=n?Pe(n):null;return we`<a data-link-type="dfn" data-link-for="${a}" data-xref-for="${a}" data-lt="${o}" >${s}</a - >`}function jr(e){const t=e.slice(1,-1);return we`<code>${t}</code>`}function zr(e){return kr.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?jr(e):zr(e))):document.createTextNode(e)}var Mr=Object.freeze({__proto__:null,name:yr,rfc2119Usage:wr,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ze,e.informativeReferences=new Ze,e.respecRFC2119||(e.respecRFC2119=wr);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=Pe(e),o=Pe(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),i=[];let s;for(;s=o.nextNode();)i.push(s);return i}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),i=xr.rfc2119Keywords(),s=new RegExp(`(${vr([i,$r,_r,Er,Sr,Cr,kr,Ar,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(s);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const s of r)if(a=!a,a)switch(!0){case s.startsWith("{{"):o.append(Nr(s,n));break;case s.startsWith("[[["):o.append(Rr(s));break;case s.startsWith("[["):o.append(...Or(s,n,e));break;case s.startsWith("|"):o.append(Ir(s));break;case s.startsWith("[="):o.append(Pr(s));break;case s.startsWith("`"):o.append(jr(s));break;case s.startsWith("[^"):o.append(Lr(s));break;case t.has(s):o.append(Dr(s,n,t));break;case i.test(s):o.append(Tr(s))}else o.append(s);n.replaceWith(o)}}});const qr="aom/conformance",Fr=je({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>we`<p> + >`}function zr(e){const t=e.slice(1,-1);return we`<code>${t}</code>`}function jr(e){return kr.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?zr(e):jr(e))):document.createTextNode(e)}var Mr=Object.freeze({__proto__:null,name:yr,rfc2119Usage:wr,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ze,e.informativeReferences=new Ze,e.respecRFC2119||(e.respecRFC2119=wr);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=Pe(e),o=Pe(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),i=[];let s;for(;s=o.nextNode();)i.push(s);return i}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),i=xr.rfc2119Keywords(),s=new RegExp(`(${vr([i,$r,_r,Er,Sr,Cr,kr,Ar,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(s);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const s of r)if(a=!a,a)switch(!0){case s.startsWith("{{"):o.append(Nr(s,n));break;case s.startsWith("[[["):o.append(Rr(s));break;case s.startsWith("[["):o.append(...Or(s,n,e));break;case s.startsWith("|"):o.append(Ir(s));break;case s.startsWith("[="):o.append(Pr(s));break;case s.startsWith("`"):o.append(zr(s));break;case s.startsWith("[^"):o.append(Lr(s));break;case t.has(s):o.append(Dr(s,n,t));break;case i.test(s):o.append(Tr(s))}else o.append(s);n.replaceWith(o)}}});const qr="aom/conformance",Fr=ze({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>we`<p> The key word${t?"s":""} ${e} in this document ${t?"are":"is"} to be interpreted as described in <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> @@ -330,7 +330,7 @@ div.illegal-example{color:red} div.illegal-example p{color:#000} :is(aside,div).example{border-left-width:.5em;border-left-style:solid;border-color:#e0cb52;background:#fcfaee} aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff} -.example pre{background-color:rgba(0,0,0,.03)}`;const ro=je({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function oo(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?we`<span class="example-title">: ${n.title}</span>`:"";return we`<div class="marker"> +.example pre{background-color:rgba(0,0,0,.03)}`;const ro=ze({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function oo(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?we`<span class="example-title">: ${n.title}</span>`:"";return we`<div class="marker"> <a class="self-link">${ro.example}<bdi>${r}</bdi></a >${o} </div>`}var io=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;document.head.insertBefore(we`<style> @@ -347,7 +347,7 @@ span.warning{padding:.1em .5em .15em} .warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em} li.task-list-item{list-style:none} input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} -.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const ao="core/issues-notes",lo=je({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"}});function co(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),o=document.createElement("ul");e.forEach((e=>{const{type:i,displayType:s,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",s=t?o?lo.feature_at_risk:lo.issue:n?lo.warning:r?lo.editors_note:lo.note;return{type:i,displayType:s,isFeatureAtRisk:o}}(e),l="issue"===i,c="span"===e.localName,{number:u}=e.dataset,d={type:i,inline:c,title:e.title,number:r(e)};if(!c){const r=we`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=we`<div role="heading" class="${`${i}-title marker`}">${c}</div>`;qe(p,"h",i);let f,h=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):qe(r,"issue-container",d.number?`number-${d.number}`:""),l){if(void 0!==d.number&&(h+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return we`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return we`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(c.before(e),e.append(c)),c.classList.add("issue-number"),f=t.get(u),!f){et(`Failed to fetch issue number ${u}.`,ao)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?we`<span style="text-transform: none">: ${t.title}</span>`:"";return we`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(lo.issue,d,r.id))}if(c.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=f?f.labels:[];f&&"CLOSED"===f.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const i=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,i,s]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*o+.7152*i+.0722*s>.179?"#000":"#fff"}(n),s=`GitHub label: ${r}`;return we` <a +.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const ao="core/issues-notes",lo=ze({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"}});function co(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),o=document.createElement("ul");e.forEach((e=>{const{type:i,displayType:s,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",s=t?o?lo.feature_at_risk:lo.issue:n?lo.warning:r?lo.editors_note:lo.note;return{type:i,displayType:s,isFeatureAtRisk:o}}(e),l="issue"===i,c="span"===e.localName,{number:u}=e.dataset,d={type:i,inline:c,title:e.title,number:r(e)};if(!c){const r=we`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=we`<div role="heading" class="${`${i}-title marker`}">${c}</div>`;qe(p,"h",i);let f,h=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):qe(r,"issue-container",d.number?`number-${d.number}`:""),l){if(void 0!==d.number&&(h+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return we`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return we`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(c.before(e),e.append(c)),c.classList.add("issue-number"),f=t.get(u),!f){et(`Failed to fetch issue number ${u}.`,ao)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?we`<span style="text-transform: none">: ${t.title}</span>`:"";return we`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(lo.issue,d,r.id))}if(c.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=f?f.labels:[];f&&"CLOSED"===f.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const i=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,i,s]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*o+.7152*i+.0722*s>.179?"#000":"#fff"}(n),s=`GitHub label: ${r}`;return we` <a class="respec-gh-label" style="${`background-color: #${n}; color: ${i}`}" href="${o.href}" @@ -355,21 +355,21 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} >${r}</a >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return we`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(i),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=Ue(p,"section").length+2;p.setAttribute("aria-level",g)}})),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(we`<p>${lo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${lo.issue_summary}</h1>`)}(o)}var uo=Object.freeze({__proto__:null,name:ao,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter((e=>e instanceof HTMLElement));if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map((e=>Number.parseInt(e.dataset.number,10))).filter((e=>e));if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return Je(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ao),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(we`<style> ${so} - </style>`,o.querySelector("link")),co(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const po="core/best-practices",fo={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},ho=je(fo),mo=l in fo?l:"en";var go=Object.freeze({__proto__:null,name:po,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=qe(e,"bp"),o=we`<a class="marker self-link" href="${`#${r}`}" + </style>`,o.querySelector("link")),co(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const po="core/best-practices",fo={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},ho=ze(fo),mo=l in fo?l:"en";var go=Object.freeze({__proto__:null,name:po,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=qe(e,"bp"),o=we`<a class="marker self-link" href="${`#${r}`}" ><bdi lang="${mo}">${ho.best_practice}${t+1}</bdi></a - >`;if(n){const t=we`<li>${o}: ${Ge(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=we`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(we`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){et("Using best practices summary (#bp-summary) but no best practices found.",po),t.remove()}}});const bo="core/figures",yo=je({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var wo=Object.freeze({__proto__:null,name:bo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;qe(e,"fig",r),We(t,we`<span class="fig-title"></span>`),t.prepend(we`<a class="self-link" href="#${e.id}" + >`;if(n){const t=we`<li>${o}: ${Ge(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=we`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(we`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){et("Using best practices summary (#bp-summary) but no best practices found.",po),t.remove()}}});const bo="core/figures",yo=ze({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var wo=Object.freeze({__proto__:null,name:bo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;qe(e,"fig",r),We(t,we`<span class="fig-title"></span>`),t.prepend(we`<a class="self-link" href="#${e.id}" >${yo.fig}<bdi class="figno">${n+1}</bdi></a >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Be(e,"span").removeAttribute("href")})),we`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> </li>`}(t.id,r));else{et("Found a `<figure>` without a `<figcaption>`.",bo,{elements:[t]})}})),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(we`<h1>${yo.list_of_figures}</h1>`,we`<ul class="tof"> ${e} - </ul>`))}});const vo="core/data-cite",xo="__SPEC__";async function ko(e){const{key:t,frag:n,path:r,href:o}=e;let i="",s="";if(t===xo)i=document.location.href;else{const e=await ir(t);if(!e)return null;i=e.href,s=e.title}if(o)i=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:s}}function $o(e,t,n){const{href:r,title:o}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?We(e,t):(t.textContent=o,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Je("Exporting an linked external definition is not allowed.",vo,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function _o(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Eo=_o("#"),So=_o("/");function Co(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:i}=r?Co(r):{key:xo,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=n.replace("#",""),Co(e)}const s=r?`#${r}`:Eo(n),a=o||So(n).split("#")[0],{type:l}=He(n,e),c="normative"===l,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:c,frag:s,path:a,href:i}}function Ao(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var Lo=Object.freeze({__proto__:null,THIS_SPEC:xo,name:vo,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(Co).map((async e=>({entry:e,result:await ir(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await or(n);r&&Object.assign(Jn,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Co(t),r=await ko(n);if(r)$o(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),et(n,vo,{elements:[t]})}}o("beforesave",Ao)},toCiteDetails:Co});const To="core/link-to-dfn",Ro=[],No={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}},Oo=je(No);function Do(e){const t=new Map,n=[];for(const r of Vr.get(e)){const{dfnType:o="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const s of i){if(t.has(s)&&t.get(s).has(o)){const e=t.get(s).get(o),i="dfn"===e.localName,a="dfn"===r.localName,l=o===(e.dataset.dfnType||"dfn"),c=!s&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(s);if(i&&a&&l&&c){n.push(r);continue}}t.has(s)||t.set(s,new Map),t.get(s).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(s).set("idl",r),qe(r,"dfn",e)}}return{result:t,duplicates:n}}function Io(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Fe(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const o=t.get(r.title).get(r.for),{linkType:i}=e.dataset;if(i)return o.get(i)||o.get("dfn");{const e=r.for?"idl":"dfn";return o.get(e)||o.get("idl")}}function Po(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&i&&!i.split(",").map((e=>e.trim())).includes(o))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),o=jo(e)&&jo(t,n);r&&!o||We(e,document.createElement("code"))}(e,t),!r}function jo(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function zo(e){e.forEach((e=>{et(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,To,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var Mo=Object.freeze({__proto__:null,name:To,possibleExternalLinks:Ro,run:async function(e){const t=function(){const e=new Qe;for(const t of Vr.keys()){const{result:n,duplicates:r}=Do(t);e.set(t,n),r.length>0&&Je(Oo.duplicateMsg(t),To,{title:Oo.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){Ro.push(e);continue}const r=Io(e,t);if(r){Po(e,r,t)||Ro.push(e)}else""===e.dataset.cite?n.push(e):Ro.push(e)}zo(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:o}=Co(t);r!==xo&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||zo(Ro)}});const qo="core/contrib";var Fo=Object.freeze({__proto__:null,name:qo,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Je(rt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,qo)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await o();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void we(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=Ie(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,i;if("caches"in window)try{if(o=await caches.open(r.origin),i=await o.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const s=await fetch(n);if(!s.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&s.ok){const e=s.clone(),r=new Headers(s.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return s}(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return Je("Error loading contributors from GitHub.",qo),console.error(e),null}}}(t,n)}});var Bo=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Be(e,`h${t}`)}))}});const Ho=["h2","h3","h4","h5","h6"],Wo="core/structure",Uo=je({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Vo(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=we`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=i,r=!0);let e=a.isIntro?"":r?Zo(i-o+1):n+i;const l=e.split(".").length;if(1===l&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(we`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Yo(a.header,n),o=Vo(a.subsections,t,{prefix:e});o&&r.append(o),s.append(r)}}return s}function Zo(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Go(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Ho.includes(r.localName))continue;const o=r.textContent;qe(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Go(e)})}return n}function Yo(e,t){const n=we`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Be(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Be(e,"span").removeAttribute("id")})),we`<li class="tocline">${n}</li>`}var Ko=Object.freeze({__proto__:null,name:Wo,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(Ue(e,"section").length+1,6)}`;e.localName!==t&&Be(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){Je("`data-max-toc` must have a value between 0-6 (inclusive).",Wo,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Vo(Go(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=we`<nav id="toc"></nav>`,n=we`<h2 class="introductory">${Uo.toc}</h2>`;qe(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const o=we`<p role="navigation" id="back-to-top"> + </ul>`))}});const vo="core/data-cite",xo="__SPEC__";async function ko(e){const{key:t,frag:n,path:r,href:o}=e;let i="",s="";if(t===xo)i=document.location.href;else{const e=await ir(t);if(!e)return null;i=e.href,s=e.title}if(o)i=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:s}}function $o(e,t,n){const{href:r,title:o}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?We(e,t):(t.textContent=o,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Je("Exporting an linked external definition is not allowed.",vo,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function _o(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Eo=_o("#"),So=_o("/");function Co(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:i}=r?Co(r):{key:xo,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=n.replace("#",""),Co(e)}const s=r?`#${r}`:Eo(n),a=o||So(n).split("#")[0],{type:l}=He(n,e),c="normative"===l,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:c,frag:s,path:a,href:i}}function Ao(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var Lo=Object.freeze({__proto__:null,THIS_SPEC:xo,name:vo,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(Co).map((async e=>({entry:e,result:await ir(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await or(n);r&&Object.assign(Jn,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Co(t),r=await ko(n);if(r)$o(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),et(n,vo,{elements:[t]})}}o("beforesave",Ao)},toCiteDetails:Co});const To="core/link-to-dfn",Ro=[],No={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}},Oo=ze(No);function Do(e){const t=new Map,n=[];for(const r of Vr.get(e)){const{dfnType:o="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const s of i){if(t.has(s)&&t.get(s).has(o)){const e=t.get(s).get(o),i="dfn"===e.localName,a="dfn"===r.localName,l=o===(e.dataset.dfnType||"dfn"),c=!s&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(s);if(i&&a&&l&&c){n.push(r);continue}}t.has(s)||t.set(s,new Map),t.get(s).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(s).set("idl",r),qe(r,"dfn",e)}}return{result:t,duplicates:n}}function Io(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Fe(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const o=t.get(r.title).get(r.for),{linkType:i}=e.dataset;if(i)return o.get(i)||o.get("dfn");{const e=r.for?"idl":"dfn";return o.get(e)||o.get("idl")}}function Po(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&i&&!i.split(",").map((e=>e.trim())).includes(o))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),o=zo(e)&&zo(t,n);r&&!o||We(e,document.createElement("code"))}(e,t),!r}function zo(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function jo(e){e.forEach((e=>{et(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,To,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var Mo=Object.freeze({__proto__:null,name:To,possibleExternalLinks:Ro,run:async function(e){const t=function(){const e=new Qe;for(const t of Vr.keys()){const{result:n,duplicates:r}=Do(t);e.set(t,n),r.length>0&&Je(Oo.duplicateMsg(t),To,{title:Oo.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){Ro.push(e);continue}const r=Io(e,t);if(r){Po(e,r,t)||Ro.push(e)}else""===e.dataset.cite?n.push(e):Ro.push(e)}jo(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:o}=Co(t);r!==xo&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||jo(Ro)}});const qo="core/contrib";var Fo=Object.freeze({__proto__:null,name:qo,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Je(rt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,qo)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await o();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void we(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=Ie(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,i;if("caches"in window)try{if(o=await caches.open(r.origin),i=await o.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const s=await fetch(n);if(!s.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&s.ok){const e=s.clone(),r=new Headers(s.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return s}(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return Je("Error loading contributors from GitHub.",qo),console.error(e),null}}}(t,n)}});var Bo=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Be(e,`h${t}`)}))}});const Ho=["h2","h3","h4","h5","h6"],Wo="core/structure",Uo=ze({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Vo(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=we`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=i,r=!0);let e=a.isIntro?"":r?Zo(i-o+1):n+i;const l=e.split(".").length;if(1===l&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(we`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Yo(a.header,n),o=Vo(a.subsections,t,{prefix:e});o&&r.append(o),s.append(r)}}return s}function Zo(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Go(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Ho.includes(r.localName))continue;const o=r.textContent;qe(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Go(e)})}return n}function Yo(e,t){const n=we`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Be(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Be(e,"span").removeAttribute("id")})),we`<li class="tocline">${n}</li>`}var Ko=Object.freeze({__proto__:null,name:Wo,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(Ue(e,"section").length+1,6)}`;e.localName!==t&&Be(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){Je("`data-max-toc` must have a value between 0-6 (inclusive).",Wo,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Vo(Go(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=we`<nav id="toc"></nav>`,n=we`<h2 class="introductory">${Uo.toc}</h2>`;qe(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const o=we`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> - </p>`;document.body.append(o)}(t)}r("toc")}});const Qo=je({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"}});var Xo=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(we`<p><em>${Qo.informative}</em></p>`)}))}});const Jo=je({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Pe(t.textContent)}`),n}}});var ei=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(qe(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=Jo.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=we`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=we`<a + </p>`;document.body.append(o)}(t)}r("toc")}});const Qo=ze({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"}});var Xo=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(we`<p><em>${Qo.informative}</em></p>`)}))}});const Jo=ze({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Pe(t.textContent)}`),n}}});var ei=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(qe(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=Jo.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=we`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=we`<a href="#${t}" class="self-link" aria-label="${r}" - ></a>`;o.append(n,i)}}});const ti="ui/save-html",ni=je({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),ri=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return it(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return it(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function oi(e,t){const{id:n,href:r,ext:o,title:i,type:s}=e,a=function(e,t=""){return Ce.format(e).replace(Se,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return we`<a + ></a>`;o.append(n,i)}}});const ti="ui/save-html",ni=ze({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),ri=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return it(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return it(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function oi(e,t){const{id:n,href:r,ext:o,title:i,type:s}=e,a=function(e,t=""){return Ce.format(e).replace(Se,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return we`<a href="${r}" id="${n}" download="${l}.${o}" @@ -379,7 +379,7 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} >${i}</a >`}var ii=Object.freeze({__proto__:null,exportDocument:function(e,t){return et("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",ti,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),it(t)},name:ti,run:function(e){const t={async show(t){await document.respec.ready;const n=we`<div class="respec-save-buttons"> ${ri.map((t=>oi(t,e)))} - </div>`;Pt.freshModal(ni.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=Pt.addCommand(ni.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const si=je({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const ai=document.createElement("div"),li=we.bind(ai),ci=Pt.addCommand(`${si.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(ui).forEach((t=>{e.push(t)}));li` + </div>`;Pt.freshModal(ni.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=Pt.addCommand(ni.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const si=ze({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const ai=document.createElement("div"),li=we.bind(ai),ci=Pt.addCommand(`${si.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(ui).forEach((t=>{e.push(t)}));li` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -436,7 +436,7 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none} var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#000} var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#000;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400} -var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Ni=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Ri,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}});var Oi=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var Di=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: ")));if(!e.length)return;for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(we`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=Oi,document.head.appendChild(t)}});const Ii="core/anchor-expander";function Pi(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching element "${t}", but it has no title or marker.`,Ii,{title:"Missing title.",elements:[n]})}const o=Ge(r);n.append(...o.childNodes),n.classList.add("box-ref")}function ji(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Ii,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ge(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=Pe(i.textContent))}function zi(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Ii,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ge(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=Pe(i.textContent))}function Mi(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)qi(r,n),Fi(r,n);else{n.textContent=n.getAttribute("href");Je("Found matching section, but the section was lacking a heading element.",Ii,{title:`No matching id in document: "${t}".`,elements:[n]})}}function qi(e,t){const n=e.querySelector(".self-link"),r=[...Ge(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Be(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Fi(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Bi=Object.freeze({__proto__:null,name:Ii,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":qi(n,t);break;case"section":Mi(n,e,t);break;case"figure":ji(n,e,t);break;case"table":zi(n,e,t);break;case"aside":case"div":Pi(n,e,t);break;default:t.textContent=t.getAttribute("href");Je("ReSpec doesn't support expanding this kind of reference.",Ii,{title:`Can't expand "#${e}".`,elements:[t]})}Fi(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Je(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Ii,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Hi=String.raw`dfn{cursor:pointer} +var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Ni=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Ri,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}});var Oi=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var Di=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: ")));if(!e.length)return;for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(we`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=Oi,document.head.appendChild(t)}});const Ii="core/anchor-expander";function Pi(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching element "${t}", but it has no title or marker.`,Ii,{title:"Missing title.",elements:[n]})}const o=Ge(r);n.append(...o.childNodes),n.classList.add("box-ref")}function zi(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Ii,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ge(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=Pe(i.textContent))}function ji(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Ii,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ge(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=Pe(i.textContent))}function Mi(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)qi(r,n),Fi(r,n);else{n.textContent=n.getAttribute("href");Je("Found matching section, but the section was lacking a heading element.",Ii,{title:`No matching id in document: "${t}".`,elements:[n]})}}function qi(e,t){const n=e.querySelector(".self-link"),r=[...Ge(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Be(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Fi(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Bi=Object.freeze({__proto__:null,name:Ii,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":qi(n,t);break;case"section":Mi(n,e,t);break;case"figure":zi(n,e,t);break;case"table":ji(n,e,t);break;case"aside":case"div":Pi(n,e,t);break;default:t.textContent=t.getAttribute("href");Je("ReSpec doesn't support expanding this kind of reference.",Ii,{title:`Can't expand "#${e}".`,elements:[t]})}Fi(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Je(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Ii,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Hi=String.raw`dfn{cursor:pointer} .dfn-panel{position:absolute;z-index:35;min-width:300px;max-width:500px;padding:.5em .75em;margin-top:.6em;font-family:"Helvetica Neue",sans-serif;font-size:small;background:#fff;color:#000;box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);border-radius:2px} .dfn-panel:not(.docked)>.caret{position:absolute;top:-9px} .dfn-panel:not(.docked)>.caret::after,.dfn-panel:not(.docked)>.caret::before{content:"";position:absolute;border:10px solid transparent;border-top:0;border-bottom:10px solid #fff;top:0} @@ -492,9 +492,9 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Ni=Obje </div> `;return s}var Ui=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(we`<style> ${Hi} - </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Wi(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return ks}))).default}catch{return hi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Vi=new Promise(((e,t)=>{}));je({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});const Zi="rs-changelog",Gi=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;we.bind(this)` + </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Wi(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return ks}))).default}catch{return hi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Vi=new Promise(((e,t)=>{}));ze({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});const Zi="rs-changelog",Gi=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;we.bind(this)` <ul> ${{any:Yi(e,t,n).then((e=>async function(e){const{repoURL:t}=await Vi;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,i=r&&we` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return we`<li><a href="${o}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>Je(e.message,Zi,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} </ul> - `}};async function Yi(e,t,n){let r;try{const o=await Vi;if(!o)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${o.apiBase}/${o.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const s=await fetch(i.href);if(!s.ok)throw new Error(`Request to ${i} failed with status code ${s.status}`);if(r=await s.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw console.error(e),new Error(t)}return r}const Ki=[Object.freeze({__proto__:null,element:Gi,name:Zi})];var Qi=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ki.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ki.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});const Xi="core/linter-rules/check-charset",Ji=je({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var es=Object.freeze({__proto__:null,name:Xi,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||et(Ji.msg,Xi,{hint:Ji.hint,elements:[...t]})}});const ts="core/linter-rules/check-punctuation",ns=[".",":","!","?"],rs=je({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${ns.map((e=>`"${e}"`)).join(", ")}.`}});var os=Object.freeze({__proto__:null,name:ts,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${ns.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&et(rs.msg,ts,{hint:rs.hint,elements:n})}});const is="core/linter-rules/local-refs-exist",ss=je({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function as(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var ls=Object.freeze({__proto__:null,name:is,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(as);t.length&&et(ss.msg,is,{hint:ss.hint,elements:t})}});const cs="core/linter-rules/no-headingless-sections",us=je({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"}});var ds=Object.freeze({__proto__:null,name:cs,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&et(us.msg,cs,{hint:us.hint,elements:t})}});const ps="core/linter-rules/no-unused-vars",fs=je({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var hs=Object.freeze({__proto__:null,name:ps,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=Pe(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&et(fs.msg,ps,{hint:fs.hint,elements:t})}});const ms="core/linter-rules/privsec-section",gs=je({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var bs=Object.freeze({__proto__:null,name:ms,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&et(gs.msg,ms,{hint:gs.hint})}});const ys="core/linter-rules/no-http-props",ws=je({en:{msg:rt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:rt`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var vs=Object.freeze({__proto__:null,name:ys,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=Ie(t,(e=>rt`${`[${e}]`}`));et(ws.msg,ys,{hint:ws.hint+e})}}}),xs=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),ks=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); + `}};async function Yi(e,t,n){let r;try{const o=await Vi;if(!o)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${o.apiBase}/${o.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const s=await fetch(i.href);if(!s.ok)throw new Error(`Request to ${i} failed with status code ${s.status}`);if(r=await s.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw console.error(e),new Error(t)}return r}const Ki=[Object.freeze({__proto__:null,element:Gi,name:Zi})];var Qi=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ki.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ki.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});const Xi="core/linter-rules/check-charset",Ji=ze({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var es=Object.freeze({__proto__:null,name:Xi,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||et(Ji.msg,Xi,{hint:Ji.hint,elements:[...t]})}});const ts="core/linter-rules/check-punctuation",ns=[".",":","!","?"],rs=ze({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${ns.map((e=>`"${e}"`)).join(", ")}.`}});var os=Object.freeze({__proto__:null,name:ts,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${ns.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&et(rs.msg,ts,{hint:rs.hint,elements:n})}});const is="core/linter-rules/local-refs-exist",ss=ze({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function as(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var ls=Object.freeze({__proto__:null,name:is,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(as);t.length&&et(ss.msg,is,{hint:ss.hint,elements:t})}});const cs="core/linter-rules/no-headingless-sections",us=ze({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"}});var ds=Object.freeze({__proto__:null,name:cs,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&et(us.msg,cs,{hint:us.hint,elements:t})}});const ps="core/linter-rules/no-unused-vars",fs=ze({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var hs=Object.freeze({__proto__:null,name:ps,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=Pe(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&et(fs.msg,ps,{hint:fs.hint,elements:t})}});const ms="core/linter-rules/privsec-section",gs=ze({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var bs=Object.freeze({__proto__:null,name:ms,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&et(gs.msg,ms,{hint:gs.hint})}});const ys="core/linter-rules/no-http-props",ws=ze({en:{msg:rt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:rt`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var vs=Object.freeze({__proto__:null,name:ys,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=Ie(t,(e=>rt`${`[${e}]`}`));et(ws.msg,ys,{hint:ws.hint+e})}}}),xs=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),ks=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); //# sourceMappingURL=respec-aom.js.map diff --git a/builds/respec-aom.js.map b/builds/respec-aom.js.map index 38dd304007..19217a6b43 100644 --- a/builds/respec-aom.js.map +++ b/builds/respec-aom.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-aom.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/reindent.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/aom.js","../src/core/location-hash.js","../src/core/defaults.js","../src/aom/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/aom/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/aom/templates/headers.js","../src/aom/headers.js","../src/aom/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/aom/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v4.2.12 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction merge(obj) {\n let i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n}\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = merge({}, block);\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = merge({}, block.normal, {\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n});\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = merge({}, block.normal, {\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = merge({}, inline);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = merge({}, inline.normal, {\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = merge({}, inline.normal, {\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n});\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n});\n\n/**\n * smartypants text replacement\n * @param {string} text\n */\nfunction smartypants(text) {\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n}\n\n/**\n * mangle email addresses\n * @param {string} text\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${level}>\\n`;\n }\n\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `<li>${text}</li>\\n`;\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `<tbody>${body}</tbody>`;\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n function onError(e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n\n try {\n const tokens = Lexer.lex(src, opt);\n if (opt.walkTokens) {\n if (opt.async) {\n return Promise.all(marked.walkTokens(tokens, opt.walkTokens))\n .then(() => {\n return Parser.parse(tokens, opt);\n })\n .catch(onError);\n }\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parse(tokens, opt);\n } catch (e) {\n onError(e);\n }\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n merge(marked.defaults, opt);\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = merge({}, pack);\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = function(src, opt) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked.parseInline(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked.parseInline(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n try {\n const tokens = Lexer.lexInline(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parseInline(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n};\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: #193766;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: white;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/aom/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/aom/style.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/aom/headers.js\"),\n import(\"../src/aom/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/aom/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for AOM specs\n */\nexport const name = \"aom/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"aom\",\n {\n name: \"Alliance for Open Media License\",\n short: \"AOM\",\n url: \"http://aomedia.org/license/\",\n },\n ],\n]);\n\nconst aomDefaults = {\n // treat document as \"Common Markdown\" (with a little bit of HTML).\n // choice between Markdown and HTML depends on the complexity of the spec\n // example of Markdown spec: https://github.com/WICG/netinfo/blob/gh-pages/index.html\n // Helpful guide: https://respec.org/docs/#markdown\n format: \"markdown\",\n logos: [\n {\n src: \"https://aomedia.org/assets/images/aomedia-icon-only.png\",\n alt: \"AOM\",\n id: \"AOM\",\n height: 170,\n width: 170,\n url: \"https://aomedia.org/\",\n },\n ],\n license: \"aom\",\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...aomDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...aomDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module aom/style\n// Inserts a link to the appropriate style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"aom/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"PD\":\n styleFile = \"W3C-UD\";\n break;\n default:\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"无标题\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} 이전 `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 以前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` 直到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () => html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n>\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n</svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest approved version:\",\n this_version: \"This version:\",\n issue_tracker: \"Issue Tracker:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`<div class=\"head\">\n ${conf.specStatus !== \"PD\" ? conf.logos.map(showLogo) : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus} -\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\">${conf.thisVersion}</a>\n </dd>\n <dt>${l10n.issue_tracker}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.issueTracker}\">${conf.issueTracker}</a>\n </dd>\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${renderCopyright(conf)}\n <hr />\n </div>`;\n};\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n return html`<p class=\"copyright\">\n Copyright ${conf.publishYear},\n <a href=\"https://www.w3.org/\"\n ><abbr title=\"The Alliance for Open Media\">AOM</abbr></a\n ><br />\n Licensing information is available at http://aomedia.org/license/<br />\n The MATERIALS ARE PROVIDED “AS IS.” The Alliance for Open Media, its\n members,and its contributors expressly disclaim any warranties (express,\n implied, or otherwise), including implied warranties of merchantability,\n non-infringement, fitness for a particular purpose, or title, related to the\n materials. The entire risk as to implementing or otherwise using the\n materials is assumed by the implementer and user. IN NO EVENT WILL THE\n ALLIANCE FOR OPEN MEDIA, ITS MEMBERS, OR CONTRIBUTORS BE LIABLE TO ANY OTHER\n PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR\n CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND\n WITH RESPECT TO THIS DELIVERABLE OR ITS GOVERNING AGREEMENT, WHETHER BASED\n ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND\n WHETHER OR NOT THE OTHER MEMBER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n DAMAGE.\n </p>`;\n}\n","// @ts-check\n// Module aom/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"aom\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"aom/headers\";\n\nconst status2text = {\n PD: \"Pre-Draft\",\n WGD: \"AOM Work Group Draft\",\n WGA: \"AOM Working Group Approved Draft\",\n FD: \"AOM Final Deliverable\",\n};\n\nconst AOMDate = new Intl.DateTimeFormat([\"en-US\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"No title\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.thisVersion = `https://aomediacodec.github.io/${conf.shortName}/`;\n conf.issueTracker = `https://github.com/AOMediaCodec/${conf.shortName}/issues/`;\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = AOMDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n // (conf.alternateFormats || []).forEach(it => {\n // if (!it.uri || !it.label) {\n // const msg = \"All alternate formats must have a uri and a label.\";\n // showError(msg, name);\n // }\n // });\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n","// @ts-check\n// Module aom/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"aom/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = `Document must have one element with \\`id=\"abstract\"`;\n showError(msg, name);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n.abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"참조\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY?\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module aom/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"aom/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before {\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n return dfnsByType.get(linkType) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","merge","key","i","arguments","length","Object","hasOwnProperty","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","trim","pop","splice","push","invert","l","suffLen","currChar","slice","checkSanitizeDeprecation","console","warn","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","marked","err","pending","setTimeout","onError","message","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","Set","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","msg","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","markdown","reindent$1","headers","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","aomDefaults","logos","alt","height","width","license","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","until","date","es","ko","ja","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","issue_tracker","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","thisVersion","issueTracker","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","publishYear","renderCopyright","status2text","PD","WGD","WGA","FD","AOMDate","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","shortName","getUTCFullYear","peopCheck","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","arg","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","nl","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACv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_ignoreList":[4,5,6,7,9]} \ No newline at end of file +{"version":3,"file":"respec-aom.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/reindent.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/aom.js","../src/core/location-hash.js","../src/core/defaults.js","../src/aom/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/aom/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/aom/templates/headers.js","../src/aom/headers.js","../src/aom/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/aom/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.normal,\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\n */\nfunction smartypants(text) {\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n}\n\n/**\n * mangle email addresses\n * @param {string} text\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${level}>\\n`;\n }\n\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `<li>${text}</li>\\n`;\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `<tbody>${body}</tbody>`;\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = parser(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...marked.defaults, ...opt };\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: #193766;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: white;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/aom/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/aom/style.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/aom/headers.js\"),\n import(\"../src/aom/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/aom/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for AOM specs\n */\nexport const name = \"aom/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"aom\",\n {\n name: \"Alliance for Open Media License\",\n short: \"AOM\",\n url: \"http://aomedia.org/license/\",\n },\n ],\n]);\n\nconst aomDefaults = {\n // treat document as \"Common Markdown\" (with a little bit of HTML).\n // choice between Markdown and HTML depends on the complexity of the spec\n // example of Markdown spec: https://github.com/WICG/netinfo/blob/gh-pages/index.html\n // Helpful guide: https://respec.org/docs/#markdown\n format: \"markdown\",\n logos: [\n {\n src: \"https://aomedia.org/assets/images/aomedia-icon-only.png\",\n alt: \"AOM\",\n id: \"AOM\",\n height: 170,\n width: 170,\n url: \"https://aomedia.org/\",\n },\n ],\n license: \"aom\",\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...aomDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...aomDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module aom/style\n// Inserts a link to the appropriate style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"aom/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"PD\":\n styleFile = \"W3C-UD\";\n break;\n default:\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"无标题\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} 이전 `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 以前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` 直到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () => html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n>\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n</svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest approved version:\",\n this_version: \"This version:\",\n issue_tracker: \"Issue Tracker:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`<div class=\"head\">\n ${conf.specStatus !== \"PD\" ? conf.logos.map(showLogo) : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus} -\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\">${conf.thisVersion}</a>\n </dd>\n <dt>${l10n.issue_tracker}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.issueTracker}\">${conf.issueTracker}</a>\n </dd>\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${renderCopyright(conf)}\n <hr />\n </div>`;\n};\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n return html`<p class=\"copyright\">\n Copyright ${conf.publishYear},\n <a href=\"https://www.w3.org/\"\n ><abbr title=\"The Alliance for Open Media\">AOM</abbr></a\n ><br />\n Licensing information is available at http://aomedia.org/license/<br />\n The MATERIALS ARE PROVIDED “AS IS.” The Alliance for Open Media, its\n members,and its contributors expressly disclaim any warranties (express,\n implied, or otherwise), including implied warranties of merchantability,\n non-infringement, fitness for a particular purpose, or title, related to the\n materials. The entire risk as to implementing or otherwise using the\n materials is assumed by the implementer and user. IN NO EVENT WILL THE\n ALLIANCE FOR OPEN MEDIA, ITS MEMBERS, OR CONTRIBUTORS BE LIABLE TO ANY OTHER\n PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR\n CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND\n WITH RESPECT TO THIS DELIVERABLE OR ITS GOVERNING AGREEMENT, WHETHER BASED\n ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND\n WHETHER OR NOT THE OTHER MEMBER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n DAMAGE.\n </p>`;\n}\n","// @ts-check\n// Module aom/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"aom\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"aom/headers\";\n\nconst status2text = {\n PD: \"Pre-Draft\",\n WGD: \"AOM Work Group Draft\",\n WGA: \"AOM Working Group Approved Draft\",\n FD: \"AOM Final Deliverable\",\n};\n\nconst AOMDate = new Intl.DateTimeFormat([\"en-US\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"No title\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.thisVersion = `https://aomediacodec.github.io/${conf.shortName}/`;\n conf.issueTracker = `https://github.com/AOMediaCodec/${conf.shortName}/issues/`;\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = AOMDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n // (conf.alternateFormats || []).forEach(it => {\n // if (!it.uri || !it.label) {\n // const msg = \"All alternate formats must have a uri and a label.\";\n // showError(msg, name);\n // }\n // });\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n","// @ts-check\n// Module aom/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"aom/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = `Document must have one element with \\`id=\"abstract\"`;\n showError(msg, name);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n.abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"참조\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY?\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module aom/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"aom/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before {\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n return dfnsByType.get(linkType) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","reindent$1","headers","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","aomDefaults","logos","alt","height","width","license","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","until","date","es","ko","ja","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","issue_tracker","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","thisVersion","issueTracker","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","publishYear","renderCopyright","status2text","PD","WGD","WGA","FD","AOMDate","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","shortName","getUTCFullYear","peopCheck","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","nl","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAAO,CAAEC,YACjDnB,OAAOsB,SAAWtB,OAAOuB,KAC3B,OAGF,MAAMC,EAAOC,OAAOC,KAAKC,UAAUR,GAAQS,OAAST,IACpDnB,OAAOsB,OAAOO,YAAY,CAAEX,QAAOM,QAAQxB,OAAOsB,OAAOQ,SAASC,OACpE,CAWO,SAASC,EAAId,EAAOe,EAAIC,EAAU,CAAEC,MAAM,IAE/CpB,EAAcqB,iBAAiBlB,GADdmB,GAAKJ,EAAGI,EAAElB,SACqBe,EAClD,CAEAtB,EAnCoB,iBAmCP,CAAEoB,QCpCf,MAAMM,EAAa,CAAC,cAAe,cCG5B,MAEDC,EAAOC,SAASC,gBAClBF,IAASA,EAAKG,aAAa,UAC7BH,EAAKI,KAAO,KACPJ,EAAKG,aAAa,SACrBH,EAAKK,IAAM,QAIR,MAAMC,EAAO,CAAA,EAEPF,EAAOJ,EAAKI,4DAZL,gBAcb,SAAaG,GAClBA,EAAOD,KAAOA,EAAKF,IAASE,EAAKE,EACnC,ICvBA,IA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5CukD,EAAqB,qBAAqBvqD,KAAKgG,GACrD,OAAQskD,GAAiBC,GAAuBD,CAAa,MAW/DvhC,GAAYnvB,GAAKyZ,IAAKzb,GAAM,CAAEuvB,KAAMvtB,GAAKutB,MAE7C,ICnCA,MACavvB,GAAO,kCAYdgC,GAAO0uB,GAVe,CAC1BxuB,GAAI,CACFuZ,IAAKma,EAAO,oCAAoC,oBAChDrG,KAAM,0DAER4W,GAAI,CACF1qB,IAAKma,EAAO,GAAG,kCACfrG,KAAM,0EAKH,SAAauL,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKvhC,OAAOQ,SAASwK,KAAKujB,WAAW,QACnC,OAGF,MAAM4jC,EAAmBz7C,OAAO07C,oBAAoB/3B,GAEjDzoB,QAAO0b,GAAQA,EAAI+H,SAAS,QAAUgF,EAAK/M,IAAiB,WAARA,IAEpD1b,QAAO0b,GACN,IAAIoB,IAAI2L,EAAK/M,GAAMttB,OAAOQ,SAASwK,MAAMA,KAAKujB,WAAW,aAG7D,GAAI4jC,EAAiBzlD,OAAQ,CAC3B,MAAMsL,EAAO+X,GAAQoiC,GAAkB7kC,GAAO6H,EAAO,GAAG,IAAI7H,SAC5DoD,GAAYnvB,GAAKyZ,IAAKzb,GAAM,CAAEuvB,KAAMvtB,GAAKutB,KAAO9W,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file diff --git a/builds/respec-dini.js b/builds/respec-dini.js index a432e6294f..1cdfc54e51 100644 --- a/builds/respec-dini.js +++ b/builds/respec-dini.js @@ -1,5 +1,5 @@ -window.respecVersion="32.8.0",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function w(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function y(e){return"function"==typeof e?w(e):(e instanceof IDBTransaction&&function(e){if(f.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=y(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&i.done]))[0]};return _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,A=/[\u000A\u000D\u0009\u0020]/u,L=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&L.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const z=/[&<>"']/,D=new RegExp(z.source,"g"),P=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,j=new RegExp(P.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},I=e=>O[e];function q(e,t){if(t){if(z.test(e))return e.replace(D,I)}else if(P.test(e))return e.replace(j,I);return e}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function F(e){return e.replace(M,((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 B=/(^|[^\[])\^/g;function W(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(B,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const H=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(e,t,n){if(e){let e;try{e=decodeURIComponent(F(n)).replace(H,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!U.test(n)&&(n=function(e,t){Z[" "+e]||(K.test(e)?Z[" "+e]=e+"/":Z[" "+e]=ee(e,"/",!0));const n=-1===(e=Z[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(X,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Z={},K=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,X=/^([^:]+:\/*[^/]*)[\s\S]*$/;const G={exec:function(){}};function Q(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function J(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),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 ee(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.slice(0,r-o)}function te(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ne(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function re(e,t,n,r){const o=t.href,i=t.title?q(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:q(s)}}class oe{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ee(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ee(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=c.slice(i),i+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const w=g.items.length;for(s=0;s<w;s++)if(this.lexer.state.top=!1,g.items[s].tokens=this.lexer.blockTokens(g.items[s].text,[]),!g.loose){const e=g.items[s].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s<w;s++)g.items[s].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:J(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n<s;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(s=e.rows.length,n=0;n<s;n++)e.rows[n]=J(e.rows[n],e.header.length).map((e=>({text:e})));for(s=e.header.length,r=0;r<s;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(s=e.rows.length,r=0;r<s;r++)for(i=e.rows[r],o=0;o<i.length;o++)i[o].tokens=this.lexer.inline(i[o].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:q(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ee(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),re(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return re(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=q(e,!0),{type:"codespan",raw:t[0],text:e}}}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[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=q(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=q(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=q(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=q(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):q(n[0]):n[0]:q(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const ie={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\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 *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:G,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ie.def=W(ie.def).replace("label",ie._label).replace("title",ie._title).getRegex(),ie.bullet=/(?:[*+-]|\d{1,9}[.)])/,ie.listItemStart=W(/^( *)(bull) */).replace("bull",ie.bullet).getRegex(),ie.list=W(ie.list).replace(/bull/g,ie.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ie.def.source+")").getRegex(),ie._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",ie._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ie.html=W(ie.html,"i").replace("comment",ie._comment).replace("tag",ie._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ie.paragraph=W(ie._paragraph).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie._tag).getRegex(),ie.blockquote=W(ie.blockquote).replace("paragraph",ie.paragraph).getRegex(),ie.normal=Q({},ie),ie.gfm=Q({},ie.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ie.gfm.table=W(ie.gfm.table).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie._tag).getRegex(),ie.gfm.paragraph=W(ie._paragraph).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ie.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie._tag).getRegex(),ie.pedantic=Q({},ie.normal,{html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ie._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+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:G,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(ie.normal._paragraph).replace("hr",ie.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ie.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:G,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)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:G,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function ae(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function le(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",se.punctuation=W(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,se.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,se._comment=W(ie._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),se.emStrong.lDelim=W(se.emStrong.lDelim).replace(/punct/g,se._punctuation).getRegex(),se.emStrong.rDelimAst=W(se.emStrong.rDelimAst,"g").replace(/punct/g,se._punctuation).getRegex(),se.emStrong.rDelimUnd=W(se.emStrong.rDelimUnd,"g").replace(/punct/g,se._punctuation).getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=W(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=W(se.tag).replace("comment",se._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=W(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=W(se.reflink).replace("label",se._label).replace("ref",ie._label).getRegex(),se.nolink=W(se.nolink).replace("ref",ie._label).getRegex(),se.reflinkSearch=W(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=Q({},se),se.pedantic=Q({},se.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:W(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=Q({},se.normal,{escape:W(se.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),se.gfm.url=W(se.gfm.url,"i").replace("email",se.gfm._extended_email).getRegex(),se.breaks=Q({},se.gfm,{br:W(se.br).replace("{2,}","*").getRegex(),text:W(se.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class ce{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:ie.normal,inline:se.normal};this.options.pedantic?(t.block=ie.pedantic,t.inline=se.pedantic):this.options.gfm&&(t.block=ie.gfm,this.options.breaks?t.inline=se.breaks:t.inline=se.gfm),this.tokenizer.rules=t}static get rules(){return{block:ie,inline:se}}static lex(e,t){return new ce(t).lex(e)}static lexInline(e,t){return new ce(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+ne("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+ne("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,i.index+i[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,le))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,le))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,ae))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}let ue=class{constructor(e){this.options=e||N}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+q(r)+'">'+(n?e:q(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:q(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class de{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,n){return""+n}image(e,t,n){return""+n}br(){return""}}class pe{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class fe{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new de,this.slugger=new pe}static parse(e,t){return new fe(t).parse(e)}static parseInline(e,t){return new fe(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,b,w,y,v,x="";const k=e.length;for(n=0;n<k;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))x+=v||"";else switch(d.type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,F(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",i=d.header.length,r=0;r<i;r++)l+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(l),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],l="",s=a.length,o=0;o<s;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:d.align[o]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,w=g.task,m="",g.task&&(y=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=y+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,w,b);x+=this.renderer.list(u,p,f);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);x+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return x}parseInline(e,t){t=t||this.renderer;let n,r,o,i="";const s=e.length;for(n=0;n<s;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=o||"";else switch(r.type){case"escape":case"text":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function he(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("function"==typeof t&&(n=t,t=null),te(t=Q({},he.defaults,t||{})),n){const r=t.highlight;let o;try{o=ce.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&he.walkTokens(o,t.walkTokens),i=fe.parse(o,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,i)};if(!r||r.length<3)return i();if(delete t.highlight,!o.length)return i();let s=0;return he.walkTokens(o,(function(e){"code"===e.type&&(s++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&i()}))}),0))})),void(0===s&&i())}function r(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+q(e.message+"",!0)+"</pre>";throw e}try{const n=ce.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(he.walkTokens(n,t.walkTokens)).then((()=>fe.parse(n,t))).catch(r);he.walkTokens(n,t.walkTokens)}return fe.parse(n,t)}catch(e){r(e)}}he.options=he.setOptions=function(e){var t;return Q(he.defaults,e),t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n=Q({},e);if(n.async=he.defaults.async||n.async,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new ue;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let i=e.renderer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new oe;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let i=e.tokenizer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.tokenizer=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");te(t=Q({},he.defaults,t||{}));try{const n=ce.lexInline(e,t);return t.walkTokens&&he.walkTokens(n,t.walkTokens),fe.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+q(e.message+"",!0)+"</pre>";throw e}},he.Parser=fe,he.parser=fe.parse,he.Renderer=ue,he.TextRenderer=de,he.Lexer=ce,he.lexer=ce.lex,he.Tokenizer=oe,he.Slugger=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline,fe.parse,ce.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return s(""===n?e[r-1]:n,o)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return l(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(o,r,e),p.isPlural=d(o,r,e),p.singular=u(r,o,t),p.isSingular=d(r,o,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var be=ge,we=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=i.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,i){for(var s=("selectedIndex"in t),a=s;r<o;){var l,c=e(n[r],1);t.insertBefore(c,i),s&&a&&c.selected&&(a=!a,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function i(e,t){return e==t}function s(e){return e}function a(e,t,n,r,o,i,s){var a=i-o;if(a<1)return-1;for(;a<=n-t;){for(var l=t,c=o;l<n&&c<i&&s(e[l],r[c]);)l++,c++;if(c===i)return t;t=l+1}return-1}function l(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function c(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var i=(r+o)/2>>>0;n<e[i]?o=i:r=1+i}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||s,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,w=0;g<m&&w<b&&u(t[g],n[w]);)g++,w++;for(;g<m&&w<b&&u(t[m-1],n[b-1]);)m--,b--;var y=g===m,v=w===b;if(y&&v)return n;if(y&&w<b)return o(d,e,n,w,b,l(d,t,g,h,f)),n;if(v&&g<m)return c(d,t,g,m),n;var x=m-g,k=b-w,$=-1;if(x<k){if(-1<($=a(n,w,b,t,g,m,u)))return o(d,e,n,w,$,d(t[g],0)),o(d,e,n,$+x,b,l(d,t,m,h,f)),n}else if(k<x&&-1<($=a(t,g,m,n,w,b,u)))return c(d,t,g,$),c(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,w,b,d(t[g],0)),c(d,t,g,m)):x==k&&function(e,t,n,r,o,i){for(;r<o&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,w,b,l(d,t,m,h,f)):function(e,t,n,r,i,s,a,l,u,d,f,h,m){!function(e,t,n,r,i,s,a,l,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:i++,f++;break;case 1:d.push(r[i]),o(t,n,r,i++,i,f<l?t(s[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(s[a])?a++:c(t,s,a++,a)}}(function(e,t,n,r,o,i,s){var a,l,c,u,d,p,f=n+i,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(l=(c=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;c<i&&l<n&&s(r[o+c],e[t+l]);)c++,l++;if(c===i&&l===n)break e;d[b+a]=c}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<c&&0<l&&s(r[o+c-1],e[t+l-1]);)m[g--]=0,c--,l--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=c-l)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,s,a,l,d,h)||function(e,t,n,r,o,i,s,a){var l=0,c=r<a?r:a,u=Array(c++),d=Array(c);d[0]=-1;for(var f=1;f<c;f++)d[f]=s;for(var h=o.slice(i,s),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(l=p(d,c,g=b+i))&&(d[l]=g,u[l]={newi:m,oldi:g,prev:u[l-1]})}for(l=--c,--s;d[l]>s;)--l;c=a+r-l;var w=Array(c),y=u[l];for(--n;y;){for(var v=y.newi,x=y.oldi;v<n;)w[--c]=1,--n;for(;x<s;)w[--c]=-1,--s;w[--c]=0,--n,--s,y=y.prev}for(;t<=n;)w[--c]=1,--n;for(;i<=s;)w[--c]=-1,--s;return w}(n,r,i,s,a,l,u,d),e,t,n,r,a,l,f,m)}(d,e,n,w,b,k,t,g,m,x,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,w={};try{w.Map=Map}catch(u){w.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var i=r(o);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,i){return n[r(o)?e:t.push(o)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var y=w.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,E,S,C,A,L={},T={},R=[],N=T.hasOwnProperty,z=0,D={attributes:L,define:function(e,t){e.indexOf("-")<0?(e in T||(z=R.push(e)),T[e]=t):L[e]=t},invoke:function(e,t){for(var n=0;n<z;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},P=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),j=(E=e,S="fragment",A="content"in I(C="template")?function(e){var t=I(C);return t.innerHTML=e,t.content}:function(e){var t,n=I(S),r=I(C);return O(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=I(S),n=I("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",O(t,n.firstChild.childNodes),t}:A)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function I(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,F,B,W,H,U,V,Z,K=(M="appendChild",F="cloneNode",B="createTextNode",H=(W="importNode")in(q=e),(U=q.createDocumentFragment())[M](q[B]("g")),U[M](q[B]("")),(H?q[W](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,s=0;n&&s<i;s++)r[M](e(o[s],n));return r}:H?q[W]:function(e,t){return e[F](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},X="-"+Math.random().toFixed(6)+"%",G=!1;try{V=e.createElement("template"),Z="tabindex","content"in V&&(V.innerHTML="<p "+Z+'="'+X+'"></p>',V.content.childNodes[0].getAttribute(Z)==X)||(X="_dt: "+X.slice(1,-1)+";",G=!0)}catch(u){}var Q="\x3c!--"+X+"--\x3e",J=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+Q+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+X+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=G?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;a<s;){var l=i[a];switch(l.nodeType){case 1:var c=o.concat(a);!function(t,n,r,o){for(var i,s=t.attributes,a=[],l=[],c=pe(s,r),u=c.length,d=0;d<u;){var p=c[d++],f=p.value===X;if(f||1<(i=p.value.split(Q)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=s[m]||s[m.toLowerCase()];if(f)n.push(he(g,o,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(he(g,o,m,i))}}l.push(p)}}for(var w=((d=0)<(u=l.length)&&G&&!("ownerSVGElement"in t));d<u;){var y=l[d++];w&&(y.value=""),t.removeAttribute(y.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=s.length,d=0;d<u;)x.setAttributeNode(s[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(l,n,r,c),fe(l,n,r,c);break;case 8:var u=l.textContent;if(u===X)r.shift(),n.push(J.test(t.nodeName)?me(t,o):{type:"any",node:l,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),a--,s--}break;case 3:J.test(t.nodeName)&&Y.call(l.textContent)===Q&&(r.shift(),n.push(me(t,o)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function we(e,t){var n=(e.convert||function(e){return e.join(Q).replace(ae,de).replace(se,ce)})(t),r=e.transform;r&&(n=r(n));var o=j(n,e.type);ve(o);var i=[];return fe(o,i,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=i.length,s=0,a=0;s<o;){var l=i[s++],c=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,l.path);switch(l.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=l.sparse,d=e.attribute(c,l.name,l.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var i=1,s=1;i<e;){var a=r[i-s];if(a.sparse){var l=a.values,c=l[0],u=1,d=l.length;for(s+=d-2;u<d;)c+=arguments[i++]+l[u++];a.fn(c)}else a.fn(arguments[i++])}return n}}}}var ye=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Y.call(r.textContent).length&&e.removeChild(r)}}var xe,ke,$e=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Ee(n,!0)}(e,t):Ee(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Ee(e,t){var n,r;return function(o){var i,s,a,l;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(s in r)s in o||(e[s]="")}else t?e.value="":e.cssText="";for(s in i=t?{}:e,o)a="number"!=typeof(l=o[s])||xe.test(s)?l:l+"px",!t&&/^--/.test(s)?i.setProperty(s,a):i[s]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=i):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Se,Ce,Ae=(Se=[].slice,(Ce=Le.prototype).ELEMENT_NODE=1,Ce.nodeType=111,Ce.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Ce.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,i=r.length;o<i;o++)t.appendChild(r[o]);return t},Le);function Le(e){var t=this.childNodes=Se.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Fe:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Me:return Re(e.render(),t);default:return e}}function Ne(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Te).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function ze(e){return null!=e&&"then"in e}var De,Pe,je,Oe,Ie,qe="ownerSVGElement",Me=v.prototype.nodeType,Fe=Ae.prototype.nodeType,Be=(Pe=(De={Event:b,WeakSet:u}).Event,je=De.WeakSet,Oe=!0,Ie=null,function(e){return Oe&&(Oe=!Oe,Ie=new je,function(e){var t=new je,n=new je;try{new MutationObserver(s).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],i=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){s(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function s(e){for(var r,o=e.length,i=0;i<o;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,i=new Pe(t),s=e.length,a=0;a<s;1===(o=e[a++]).nodeType&&function e(t,n,r,o,i){Ie.has(t)&&!o.has(t)&&(i.delete(t),o.add(t),t.dispatchEvent(n));for(var s=t.children||[],a=s.length,l=0;l<a;e(s[l++],n,r,o,i));}(o,i,t,n,r));}}(e.ownerDocument)),Ie.add(e),e}),We=/^(?:form|list)$/i,He=[].slice;function Ue(t){return this.type=t,function(t){var n=ye,r=ve;return function(o){var i,s,a;return n!==o&&(i=t,s=n=o,a=be.get(s)||be.set(s,we(i,s)),r=a.updates(K.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ve=!(Ue.prototype={attribute:function(e,t,n){var r,o=qe in e;if("style"===t)return $e(e,n,o);if("."===t.slice(0,1))return c=e,u=t.slice(1),o?function(e){try{c[u]=e}catch(t){c.setAttribute(u,e)}}:function(e){c[u]=e};if("?"===t.slice(0,1))return s=e,a=t.slice(1),function(e){l!==!!e&&((l=!!e)?s.setAttribute(a,""):s.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?Be(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!o&&t in e&&!We.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var o=D.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var s,a,l,c,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Re,before:e},o=qe in e?"svg":"html",i=!1;return function s(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=h(e.parentNode,t,[(l=a,e.ownerDocument.createTextNode(l))],r));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=h(e.parentNode,t,[],r);break}default:if(i=!1,P(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":s({html:a});break;case"object":if(P(a[0])&&(a=a.concat.apply([],a)),ze(a[0])){Promise.all(a).then(s);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?He.call(a.childNodes):[a],r):ze(a)?a.then(s):"placeholder"in a?Ne(a,s):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=h(e.parentNode,t,He.call(j([].concat(a.html).join(""),o).childNodes),r):s("length"in a?He.call(a):D.invoke(a,s))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?ze(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?He.call(r).join(""):D.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ze=function(t){var r,o,i,s,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),l=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||l?(o={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Ze=l?i:(s=new n,function(e){return s.get(e)||(n=i(t=e),s.set(t,n),n);var t,n})):Ve=!0,Ke(t)};function Ke(e){return Ve?e:Ze(e)}function Ye(e){for(var t=arguments.length,n=[Ke(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Xe=new n,Ge=function(e){var t,n,r;return function(){var o=Ye.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ue(e),t=Je(n.apply(n,o))):n.apply(n,o),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Xe.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Xe.set(e,r={}),r[o]||(r[o]=Ge(t))},Je=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ae(t):e},et=new n;function tt(){var e=et.get(this),t=Ye.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ue(qe in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,ot,it,st=D.define,at=Ue.prototype;function lt(e){return arguments.length<2?null==e?Ge("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Ge("html")(e):"nodeType"in e?lt.bind(e):Qe(e,"html"):("raw"in e?Ge("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=st,lt.diff=h,(lt.hyper=lt).observe=Be,lt.tagger=at,lt.wire=function(e,t){return null==e?Ge(t||"html"):Qe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Ge,rt=new n,ot=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var i,s,a,l=t.get(e)||it(e,t);switch(typeof o){case"object":case"function":var c=l.w||(l.w=new n);return c.get(o)||(i=c,s=o,a=new e(r),i.set(s,a),a);default:var u=l.p||(l.p=ot(null));return u[o]||(u[o]=new e(r))}}(this,rt.get(e)||(r=e,o=new y,rt.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",nt),svg:x("svg",nt),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),lt}(document); -/*! (c) Andrea Giammarchi (ISC) */const ye=we,ve=S,xe=he,ke=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",o=null,i=new Map,s="type",a=Array.from(e);for(let e=0;e<a.length;e++){const l=a[e];switch(s){case"type":if("/"===l){s="subtype";continue}t+=l;break;case"subtype":if(";"===l){s="param-start";continue}n+=l;break;case"param-start":if(A.test(l)||";"===l)continue;r+=l,s="param-name";break;case"param-name":if("="===l||";"===l){if("="===l){s="param-value",o=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=l;break;case"param-value":if('"'==l){s="collect-quoted-string";continue}if(";"===l){o=o.trimEnd(),s="param-start",T(i,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){T(i,r,o),s="ignore-input-until-next-param",r="",o=null;continue}if("\\"===l)continue;o="string"==typeof o?o+l:l;break;case"ignore-input-until-next-param":if(";"!==l)continue;s="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${s} `)}}r&&T(i,r,o);if(""===t.trim()||!C.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!C.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(i.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?C.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},$e=be;function _e(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Ee=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Se=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ae="en"===l||l.startsWith("en-")?"en-AU":l,Le=new Intl.DateTimeFormat(Ae,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ae?"2-digit":"numeric"});function Te(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Re(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Ne(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const ze=Ne("conjunction"),De=Ne("disjunction");function Pe(e,t){return ze(e,t).join("")}function je(e){return e.trim().replace(/\s+/g," ")}function Oe(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Ie(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){et(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function qe(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>ye`${e}, `));return ye`${r}${n[n.length-1]}`}function Me(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function Fe(e){const t=new Set,n="ltNodefault"in e.dataset?"":je(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>je(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(je(e))))}return[...t]}function Be(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function We(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function He(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Ue(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Ve(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Ze extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Ke(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Be(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ye(t),t}function Ye(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Xe(t)])e.remove()}function*Xe(e){for(;e.nextNode();)yield e.currentNode}class Ge extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Qe extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||Me(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:s,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:s,details:a,stack:n}}}function Je(e,t,n={}){const o={...n,isWarning:!1};r("error",new Qe(e,t,o))}function et(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Qe(e,t,o))}function tt(e){return e?`\`${e}\``:""}function nt(e,{quotes:t}={quotes:!1}){return De(e,t?e=>{return tt((t=e,String(t)?`"${t}"`:""));var t}:tt).join("")}function rt(e,...t){return _e(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,i]=r.slice(1,-1).split("|");if(i){return`${e}[${o}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}const ot=new Map([["text/html","html"],["application/xml","xml"]]);function it(e,t=document){const n=ot.get(e);if(!n){const t=[...ot.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=st(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function st(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ye(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Re(o);const i=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&i.appendChild(s);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=ye`<meta charset="utf-8" />`);i.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=ye` +window.respecVersion="32.8.1",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return h.get(e);if("objectStoreNames"===t)return e.objectStoreNames||f.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return f.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(h.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)}));h.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&i.done]))[0]};return _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,A=/[\u000A\u000D\u0009\u0020]/u,L=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&L.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const z=/[&<>"']/,D=new RegExp(z.source,"g"),P=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,j=new RegExp(P.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},I=e=>O[e];function q(e,t){if(t){if(z.test(e))return e.replace(D,I)}else if(P.test(e))return e.replace(j,I);return e}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function F(e){return e.replace(M,((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 B=/(^|[^\[])\^/g;function H(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(B,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const W=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(e,t,n){if(e){let e;try{e=decodeURIComponent(F(n)).replace(W,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!U.test(n)&&(n=function(e,t){Z[" "+e]||(K.test(e)?Z[" "+e]=e+"/":Z[" "+e]=J(e,"/",!0));const n=-1===(e=Z[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(X,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Z={},K=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,X=/^([^:]+:\/*[^/]*)[\s\S]*$/;const G={exec:function(){}};function Q(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),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 J(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.slice(0,r-o)}function ee(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,i=t.title?q(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:q(s)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:J(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=J(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,l,c,u,d,p,h,f=t[1].trim();const m=f.length>1,g={type:"list",raw:"",ordered:m,start:m?+f.slice(0,-1):"",loose:!1,items:[]};f=m?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=m?f:"[*+-]");const b=new RegExp(`^( {0,3}${f})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(h=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=c.slice(i),i+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),h=!0),!h){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(s=0;s<y;s++)if(this.lexer.state.top=!1,g.items[s].tokens=this.lexer.blockTokens(g.items[s].text,[]),!g.loose){const e=g.items[s].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s<y;s++)g.items[s].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Q(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n<s;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(s=e.rows.length,n=0;n<s;n++)e.rows[n]=Q(e.rows[n],e.header.length).map((e=>({text:e})));for(s=e.header.length,r=0;r<s;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(s=e.rows.length,r=0;r<s;r++)for(i=e.rows[r],o=0;o<i.length;o++)i[o].tokens=this.lexer.inline(i[o].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:q(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=J(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=q(e,!0),{type:"codespan",raw:t[0],text:e}}}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[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=q(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=q(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=q(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=q(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):q(n[0]):n[0]:q(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\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 *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:G,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=H(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=H(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=H(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,re.html=H(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=H(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=H(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic={...re.normal,html:H("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:G,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:G,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)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:G,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function ie(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function se(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=H(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=H(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=H(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=H(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=H(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=H(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=H(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=H(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=H(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=H(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=H(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...oe.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:H(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:H(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oe.gfm.url=H(oe.gfm.url,"i").replace("email",oe.gfm._extended_email).getRegex(),oe.breaks={...oe.gfm,br:H(oe.br).replace("{2,}","*").getRegex(),text:H(oe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class ae{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:re.normal,inline:oe.normal};this.options.pedantic?(t.block=re.pedantic,t.inline=oe.pedantic):this.options.gfm&&(t.block=re.gfm,this.options.breaks?t.inline=oe.breaks:t.inline=oe.gfm),this.tokenizer.rules=t}static get rules(){return{block:re,inline:oe}}static lex(e,t){return new ae(t).lex(e)}static lexInline(e,t){return new ae(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,i.index+i[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,se))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,se))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,ie))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+q(r)+'">'+(n?e:q(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:q(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class ce{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,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ue{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,h,f,m,g,b,y,w,v,x="";const k=e.length;for(n=0;n<k;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))x+=v||"";else switch(d.type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,F(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",i=d.header.length,r=0;r<i;r++)l+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(l),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],l="",s=a.length,o=0;o<s;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:d.align[o]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,h=d.start,f=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),f?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,f),u+=this.renderer.listitem(m,y,b);x+=this.renderer.list(u,p,h);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);x+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return x}parseInline(e,t){t=t||this.renderer;let n,r,o,i="";const s=e.length;for(n=0;n<s;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=o||"";else switch(r.type){case"escape":case"text":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}class pe{constructor(e){this.options=e||N}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function he(e,t){return(n,r,o)=>{"function"==typeof r&&(o=r,r=null);const i={...r},s=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+q(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...fe.defaults,...i}).silent,r.async,o);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return s(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&fe.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?s(e):o(null,n)};if(!i||i.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return fe.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(fe.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&fe.walkTokens(o,r.walkTokens);let i=t(o,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return s(e)}}}function fe(e,t,n){return he(ae.lex,de.parse)(e,t,n)}fe.options=fe.setOptions=function(e){var t;return fe.defaults={...fe.defaults,...e},t=fe.defaults,N=t,fe},fe.getDefaults=R,fe.defaults=N,fe.use=function(...e){const t=fe.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=fe.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=fe.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let i=e.renderer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.renderer=t}if(e.tokenizer){const t=fe.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let i=e.tokenizer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.tokenizer=t}if(e.hooks){const t=fe.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(fe.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,o);return r.call(t,i)}:t[n]=(...o)=>{let i=e.hooks[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.hooks=t}if(e.walkTokens){const t=fe.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}fe.setOptions(n)}))},fe.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(fe,r)),r.type){case"table":for(const e of r.header)n=n.concat(fe.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(fe.walkTokens(r.tokens,t));break;case"list":n=n.concat(fe.walkTokens(r.items,t));break;default:fe.defaults.extensions&&fe.defaults.extensions.childTokens&&fe.defaults.extensions.childTokens[r.type]?fe.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(fe.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(fe.walkTokens(r.tokens,t)))}return n},fe.parseInline=he(ae.lexInline,de.parseInline),fe.Parser=de,fe.parser=de.parse,fe.Renderer=le,fe.TextRenderer=ce,fe.Lexer=ae,fe.lexer=ae.lex,fe.Tokenizer=ne,fe.Slugger=ue,fe.Hooks=pe,fe.parse=fe,fe.options,fe.setOptions,fe.use,fe.walkTokens,fe.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return s(""===n?e[r-1]:n,o)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return l(t,i)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(o,r,e),p.isPlural=d(o,r,e),p.singular=u(r,o,t),p.isSingular=d(r,o,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var be=ge,ye=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=i.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,i){for(var s=("selectedIndex"in t),a=s;r<o;){var l,c=e(n[r],1);t.insertBefore(c,i),s&&a&&c.selected&&(a=!a,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function i(e,t){return e==t}function s(e){return e}function a(e,t,n,r,o,i,s){var a=i-o;if(a<1)return-1;for(;a<=n-t;){for(var l=t,c=o;l<n&&c<i&&s(e[l],r[c]);)l++,c++;if(c===i)return t;t=l+1}return-1}function l(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function c(e,t,n,r){for(;n<r;)h(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var i=(r+o)/2>>>0;n<e[i]?o=i:r=1+i}return r},h=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function f(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||s,h=null==r.before?null:d(r.before,0),f=t.length,m=f,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return o(d,e,n,y,b,l(d,t,g,f,h)),n;if(v&&g<m)return c(d,t,g,m),n;var x=m-g,k=b-y,$=-1;if(x<k){if(-1<($=a(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+x,b,l(d,t,m,f,h)),n}else if(k<x&&-1<($=a(t,g,m,n,y,b,u)))return c(d,t,g,$),c(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,y,b,d(t[g],0)),c(d,t,g,m)):x==k&&function(e,t,n,r,o,i){for(;r<o&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,y,b,l(d,t,m,f,h)):function(e,t,n,r,i,s,a,l,u,d,h,f,m){!function(e,t,n,r,i,s,a,l,u){for(var d=[],p=e.length,h=a,f=0;f<p;)switch(e[f++]){case 0:i++,h++;break;case 1:d.push(r[i]),o(t,n,r,i++,i,h<l?t(s[h],0):u);break;case-1:h++}for(f=0;f<p;)switch(e[f++]){case 0:a++;break;case-1:-1<d.indexOf(s[a])?a++:c(t,s,a++,a)}}(function(e,t,n,r,o,i,s){var a,l,c,u,d,p,h=n+i,f=[];e:for(b=0;b<=h;b++){if(50<b)return null;for(p=b-1,u=b?f[b-1]:[0,0],d=f[b]=[],a=-b;a<=b;a+=2){for(l=(c=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;c<i&&l<n&&s(r[o+c],e[t+l]);)c++,l++;if(c===i&&l===n)break e;d[b+a]=c}}for(var m=Array(b/2+h/2),g=m.length-1,b=f.length-1;0<=b;b--){for(;0<c&&0<l&&s(r[o+c-1],e[t+l-1]);)m[g--]=0,c--,l--;if(!b)break;p=b-1,u=b?f[b-1]:[0,0],(a=c-l)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,s,a,l,d,f)||function(e,t,n,r,o,i,s,a){var l=0,c=r<a?r:a,u=Array(c++),d=Array(c);d[0]=-1;for(var h=1;h<c;h++)d[h]=s;for(var f=o.slice(i,s),m=t;m<n;m++){var g,b=f.indexOf(e[m]);-1<b&&-1<(l=p(d,c,g=b+i))&&(d[l]=g,u[l]={newi:m,oldi:g,prev:u[l-1]})}for(l=--c,--s;d[l]>s;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,x=w.oldi;v<n;)y[--c]=1,--n;for(;x<s;)y[--c]=-1,--s;y[--c]=0,--n,--s,w=w.prev}for(;t<=n;)y[--c]=1,--n;for(;i<=s;)y[--c]=-1,--s;return y}(n,r,i,s,a,l,u,d),e,t,n,r,a,l,h,m)}(d,e,n,y,b,k,t,g,m,x,f,u,h),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var i=r(o);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,i){return n[r(o)?e:t.push(o)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,E,S,C,A,L={},T={},R=[],N=T.hasOwnProperty,z=0,D={attributes:L,define:function(e,t){e.indexOf("-")<0?(e in T||(z=R.push(e)),T[e]=t):L[e]=t},invoke:function(e,t){for(var n=0;n<z;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},P=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),j=(E=e,S="fragment",A="content"in I(C="template")?function(e){var t=I(C);return t.innerHTML=e,t.content}:function(e){var t,n=I(S),r=I(C);return O(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=I(S),n=I("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",O(t,n.firstChild.childNodes),t}:A)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function I(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,F,B,H,W,U,V,Z,K=(M="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(q=e),(U=q.createDocumentFragment())[M](q[B]("g")),U[M](q[B]("")),(W?q[H](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,s=0;n&&s<i;s++)r[M](e(o[s],n));return r}:W?q[H]:function(e,t){return e[F](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},X="-"+Math.random().toFixed(6)+"%",G=!1;try{V=e.createElement("template"),Z="tabindex","content"in V&&(V.innerHTML="<p "+Z+'="'+X+'"></p>',V.content.childNodes[0].getAttribute(Z)==X)||(X="_dt: "+X.slice(1,-1)+";",G=!0)}catch(u){}var Q="\x3c!--"+X+"--\x3e",J=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+Q+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+X+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=G?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function he(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;a<s;){var l=i[a];switch(l.nodeType){case 1:var c=o.concat(a);!function(t,n,r,o){for(var i,s=t.attributes,a=[],l=[],c=pe(s,r),u=c.length,d=0;d<u;){var p=c[d++],h=p.value===X;if(h||1<(i=p.value.split(Q)).length){var f=p.name;if(a.indexOf(f)<0){a.push(f);var m=r.shift().replace(h?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+f+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=s[m]||s[m.toLowerCase()];if(h)n.push(fe(g,o,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(fe(g,o,m,i))}}l.push(p)}}for(var y=((d=0)<(u=l.length)&&G&&!("ownerSVGElement"in t));d<u;){var w=l[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=s.length,d=0;d<u;)x.setAttributeNode(s[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(l,n,r,c),he(l,n,r,c);break;case 8:var u=l.textContent;if(u===X)r.shift(),n.push(J.test(t.nodeName)?me(t,o):{type:"any",node:l,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),a--,s--}break;case 3:J.test(t.nodeName)&&Y.call(l.textContent)===Q&&(r.shift(),n.push(me(t,o)))}a++}}function fe(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(Q).replace(ae,de).replace(se,ce)})(t),r=e.transform;r&&(n=r(n));var o=j(n,e.type);ve(o);var i=[];return he(o,i,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=i.length,s=0,a=0;s<o;){var l=i[s++],c=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,l.path);switch(l.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=l.sparse,d=e.attribute(c,l.name,l.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var i=1,s=1;i<e;){var a=r[i-s];if(a.sparse){var l=a.values,c=l[0],u=1,d=l.length;for(s+=d-2;u<d;)c+=arguments[i++]+l[u++];a.fn(c)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Y.call(r.textContent).length&&e.removeChild(r)}}var xe,ke,$e=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Ee(n,!0)}(e,t):Ee(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Ee(e,t){var n,r;return function(o){var i,s,a,l;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(s in r)s in o||(e[s]="")}else t?e.value="":e.cssText="";for(s in i=t?{}:e,o)a="number"!=typeof(l=o[s])||xe.test(s)?l:l+"px",!t&&/^--/.test(s)?i.setProperty(s,a):i[s]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=i):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Se,Ce,Ae=(Se=[].slice,(Ce=Le.prototype).ELEMENT_NODE=1,Ce.nodeType=111,Ce.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Ce.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,i=r.length;o<i;o++)t.appendChild(r[o]);return t},Le);function Le(e){var t=this.childNodes=Se.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Fe:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Me:return Re(e.render(),t);default:return e}}function Ne(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Te).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function ze(e){return null!=e&&"then"in e}var De,Pe,je,Oe,Ie,qe="ownerSVGElement",Me=v.prototype.nodeType,Fe=Ae.prototype.nodeType,Be=(Pe=(De={Event:b,WeakSet:u}).Event,je=De.WeakSet,Oe=!0,Ie=null,function(e){return Oe&&(Oe=!Oe,Ie=new je,function(e){var t=new je,n=new je;try{new MutationObserver(s).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],i=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){s(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function s(e){for(var r,o=e.length,i=0;i<o;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,i=new Pe(t),s=e.length,a=0;a<s;1===(o=e[a++]).nodeType&&function e(t,n,r,o,i){Ie.has(t)&&!o.has(t)&&(i.delete(t),o.add(t),t.dispatchEvent(n));for(var s=t.children||[],a=s.length,l=0;l<a;e(s[l++],n,r,o,i));}(o,i,t,n,r));}}(e.ownerDocument)),Ie.add(e),e}),He=/^(?:form|list)$/i,We=[].slice;function Ue(t){return this.type=t,function(t){var n=we,r=ve;return function(o){var i,s,a;return n!==o&&(i=t,s=n=o,a=be.get(s)||be.set(s,ye(i,s)),r=a.updates(K.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ve=!(Ue.prototype={attribute:function(e,t,n){var r,o=qe in e;if("style"===t)return $e(e,n,o);if("."===t.slice(0,1))return c=e,u=t.slice(1),o?function(e){try{c[u]=e}catch(t){c.setAttribute(u,e)}}:function(e){c[u]=e};if("?"===t.slice(0,1))return s=e,a=t.slice(1),function(e){l!==!!e&&((l=!!e)?s.setAttribute(a,""):s.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?Be(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!o&&t in e&&!He.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var o=D.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var s,a,l,c,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Re,before:e},o=qe in e?"svg":"html",i=!1;return function s(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=f(e.parentNode,t,[(l=a,e.ownerDocument.createTextNode(l))],r));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=f(e.parentNode,t,[],r);break}default:if(i=!1,P(n=a))if(0===a.length)t.length&&(t=f(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":s({html:a});break;case"object":if(P(a[0])&&(a=a.concat.apply([],a)),ze(a[0])){Promise.all(a).then(s);break}default:t=f(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=f(e.parentNode,t,11===a.nodeType?We.call(a.childNodes):[a],r):ze(a)?a.then(s):"placeholder"in a?Ne(a,s):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=f(e.parentNode,t,We.call(j([].concat(a.html).join(""),o).childNodes),r):s("length"in a?We.call(a):D.invoke(a,s))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?ze(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?We.call(r).join(""):D.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ze=function(t){var r,o,i,s,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),l=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||l?(o={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Ze=l?i:(s=new n,function(e){return s.get(e)||(n=i(t=e),s.set(t,n),n);var t,n})):Ve=!0,Ke(t)};function Ke(e){return Ve?e:Ze(e)}function Ye(e){for(var t=arguments.length,n=[Ke(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Xe=new n,Ge=function(e){var t,n,r;return function(){var o=Ye.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ue(e),t=Je(n.apply(n,o))):n.apply(n,o),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Xe.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Xe.set(e,r={}),r[o]||(r[o]=Ge(t))},Je=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ae(t):e},et=new n;function tt(){var e=et.get(this),t=Ye.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ue(qe in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,ot,it,st=D.define,at=Ue.prototype;function lt(e){return arguments.length<2?null==e?Ge("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Ge("html")(e):"nodeType"in e?lt.bind(e):Qe(e,"html"):("raw"in e?Ge("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=st,lt.diff=f,(lt.hyper=lt).observe=Be,lt.tagger=at,lt.wire=function(e,t){return null==e?Ge(t||"html"):Qe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Ge,rt=new n,ot=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var i,s,a,l=t.get(e)||it(e,t);switch(typeof o){case"object":case"function":var c=l.w||(l.w=new n);return c.get(o)||(i=c,s=o,a=new e(r),i.set(s,a),a);default:var u=l.p||(l.p=ot(null));return u[o]||(u[o]=new e(r))}}(this,rt.get(e)||(r=e,o=new w,rt.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",nt),svg:x("svg",nt),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),lt}(document); +/*! (c) Andrea Giammarchi (ISC) */const we=ye,ve=S,xe=fe,ke=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",o=null,i=new Map,s="type",a=Array.from(e);for(let e=0;e<a.length;e++){const l=a[e];switch(s){case"type":if("/"===l){s="subtype";continue}t+=l;break;case"subtype":if(";"===l){s="param-start";continue}n+=l;break;case"param-start":if(A.test(l)||";"===l)continue;r+=l,s="param-name";break;case"param-name":if("="===l||";"===l){if("="===l){s="param-value",o=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=l;break;case"param-value":if('"'==l){s="collect-quoted-string";continue}if(";"===l){o=o.trimEnd(),s="param-start",T(i,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){T(i,r,o),s="ignore-input-until-next-param",r="",o=null;continue}if("\\"===l)continue;o="string"==typeof o?o+l:l;break;case"ignore-input-until-next-param":if(";"!==l)continue;s="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${s} `)}}r&&T(i,r,o);if(""===t.trim()||!C.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!C.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(i.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?C.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},$e=be;function _e(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Ee=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Se=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ae="en"===l||l.startsWith("en-")?"en-AU":l,Le=new Intl.DateTimeFormat(Ae,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ae?"2-digit":"numeric"});function Te(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Re(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Ne(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const ze=Ne("conjunction"),De=Ne("disjunction");function Pe(e,t){return ze(e,t).join("")}function je(e){return e.trim().replace(/\s+/g," ")}function Oe(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Ie(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){et(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function qe(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>we`${e}, `));return we`${r}${n[n.length-1]}`}function Me(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function Fe(e){const t=new Set,n="ltNodefault"in e.dataset?"":je(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>je(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(je(e))))}return[...t]}function Be(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function He(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function We(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Ue(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Ve(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Ze extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Ke(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Be(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ye(t),t}function Ye(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Xe(t)])e.remove()}function*Xe(e){for(;e.nextNode();)yield e.currentNode}class Ge extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Qe extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||Me(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:s,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:s,details:a,stack:n}}}function Je(e,t,n={}){const o={...n,isWarning:!1};r("error",new Qe(e,t,o))}function et(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Qe(e,t,o))}function tt(e){return e?`\`${e}\``:""}function nt(e,{quotes:t}={quotes:!1}){return De(e,t?e=>{return tt((t=e,String(t)?`"${t}"`:""));var t}:tt).join("")}function rt(e,...t){return _e(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,i]=r.slice(1,-1).split("|");if(i){return`${e}[${o}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}const ot=new Map([["text/html","html"],["application/xml","xml"]]);function it(e,t=document){const n=ot.get(e);if(!n){const t=[...ot.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=st(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function st(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ye(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Re(o);const i=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&i.appendChild(s);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=we`<meta charset="utf-8" />`);i.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=we` <meta name="generator" content="${l}" /> `;i.appendChild(c),t.prepend(i),r("beforesave",o)}(n);let o="";if("xml"===e)o=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(o+=(new XMLSerializer).serializeToString(n.doctype)),o+=n.documentElement.outerHTML;return o}t("core/exporter",{rsDocToDataURL:it});class at{constructor(){this._respecDonePromise=new Promise((e=>{o("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],o("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),o("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return st("html",document)}}const lt="core/post-process";const ct="core/pre-process";const ut="core/base-runner";async function dt(e){!function(){const e=new at;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),o("amend-user-config",n),o("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),o=Object.fromEntries(n);Object.assign(e,o),r("amend-user-config",o)}(respecConfig),performance.mark(`${ut}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `preProcess` must be a JS function.",ct),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`preProcess\`.`,ct,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),respecConfig.state={},await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const i=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(i),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},r("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `postProcess` must be a JS function.",lt),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`postProcess\`.`,lt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Re(document),performance.mark(`${ut}-end`),performance.measure(ut,`${ut}-start`,`${ut}-end`)}var pt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} @@ -65,28 +65,28 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center} .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px} p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} -.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const ft=/>/gm,ht=/&/gm;class mt extends xe.Renderer{code(e,t,n){const{language:r,...o}=mt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const i=super.code(e,r,n),{example:s,illegalExample:a}=o;if(!s&&!a)return i;const l=s||a,c=`${r} ${s?"example":"illegal-example"}`;return i.replace("<pre>",`<pre title="${l}" class="${c}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const ht=/>/gm,ft=/&/gm;class mt extends xe.Renderer{code(e,t,n){const{language:r,...o}=mt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const i=super.code(e,r,n),{example:s,illegalExample:a}=o;if(!s&&!a)return i;const l=s||a,c=`${r} ${s?"example":"illegal-example"}`;return i.replace("<pre>",`<pre title="${l}" class="${c}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` <figure> <img src="${e}" alt="${n}" /> <figcaption>${t}</figcaption> </figure> - `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e,t,n,r){const o=/(.+)\s+{#([\w-]+)}$/;if(o.test(e)){const[,n,r]=e.match(o);return`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}const gt={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new mt};function bt(e,t={inline:!1}){const n=_e(e).replace(ft,">").replace(ht,"&");return t.inline?xe.parseInline(n,gt):xe.parse(n,gt)}function wt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=bt(e.innerHTML)}const yt=(vt="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(vt);return t.forEach(wt),Array.from(t)});var vt;var xt=Object.freeze({__proto__:null,markdownToHtml:bt,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void yt(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=Ve(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),wt(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function kt(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=pt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const $t=ye`<div id="respec-ui" class="removeOnSave" hidden></div>`,_t=ye`<ul + `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e,t,n,r){const o=/(.+)\s+{#([\w-]+)}$/;if(o.test(e)){const[,n,r]=e.match(o);return`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}const gt={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new mt};function bt(e,t={inline:!1}){const n=_e(e).replace(ht,">").replace(ft,"&");return t.inline?xe.parseInline(n,gt):xe.parse(n,gt)}function yt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=bt(e.innerHTML)}const wt=(vt="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(vt);return t.forEach(yt),Array.from(t)});var vt;var xt=Object.freeze({__proto__:null,markdownToHtml:bt,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void wt(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=Ve(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),yt(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function kt(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=pt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const $t=we`<div id="respec-ui" class="removeOnSave" hidden></div>`,_t=we`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" hidden -></ul>`,Et=ye`<button +></ul>`,Et=we`<button class="close-button" onclick=${()=>jt.closeModal()} title="Close" > ❌ -</button>`;let St,Ct;window.addEventListener("load",(()=>zt(_t)));const At=[],Lt=[],Tt={};o("start-all",(()=>document.body.prepend($t)),{once:!0}),o("end-all",(()=>document.body.prepend($t)),{once:!0});const Rt=ye`<button id="respec-pill" disabled>ReSpec</button>`;function Nt(){_t.classList.toggle("respec-hidden"),_t.classList.toggle("respec-visible"),_t.hidden=!_t.hidden}function zt(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}$t.appendChild(Rt),Rt.addEventListener("click",(e=>{e.stopPropagation(),Rt.setAttribute("aria-expanded",String(_t.hidden)),Nt(),_t.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{_t.hidden||Nt()})),$t.appendChild(_t),_t.addEventListener("keydown",(e=>{"Escape"!==e.key||_t.hidden||(Rt.setAttribute("aria-expanded",String(_t.hidden)),Nt(),Rt.focus())}));const Dt=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Pt(e,t,n,r){t.push(e),Tt.hasOwnProperty(n)||(Tt[n]=function(e,t,n){const r=ye`<button +</button>`;let St,Ct;window.addEventListener("load",(()=>zt(_t)));const At=[],Lt=[],Tt={};o("start-all",(()=>document.body.prepend($t)),{once:!0}),o("end-all",(()=>document.body.prepend($t)),{once:!0});const Rt=we`<button id="respec-pill" disabled>ReSpec</button>`;function Nt(){_t.classList.toggle("respec-hidden"),_t.classList.toggle("respec-visible"),_t.hidden=!_t.hidden}function zt(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}$t.appendChild(Rt),Rt.addEventListener("click",(e=>{e.stopPropagation(),Rt.setAttribute("aria-expanded",String(_t.hidden)),Nt(),_t.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{_t.hidden||Nt()})),$t.appendChild(_t),_t.addEventListener("keydown",(e=>{"Escape"!==e.key||_t.hidden||(Rt.setAttribute("aria-expanded",String(_t.hidden)),Nt(),Rt.focus())}));const Dt=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Pt(e,t,n,r){t.push(e),Tt.hasOwnProperty(n)||(Tt[n]=function(e,t,n){const r=we`<button id="${`respec-pill-${e}`}" class="respec-info-button" - ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=ye`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(Ot(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),o.appendChild(n)}jt.freshModal(n,o,r)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return kt(r,o),r}(n,t,r),$t.appendChild(Tt[n]));const o=Tt[n];o.textContent=t.length;const i=1===t.length?$e.singular(r):r;kt(o,new Map([["label",`${t.length} ${i}`]]))}kt(Rt,Dt);const jt={show(){try{$t.hidden=!1}catch(e){console.error(e)}},hide(){$t.hidden=!0},enable(){Rt.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=ye`<button id="${o}" class="respec-option"> + ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=we`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(Ot(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),o.appendChild(n)}jt.freshModal(n,o,r)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return kt(r,o),r}(n,t,r),$t.appendChild(Tt[n]));const o=Tt[n];o.textContent=t.length;const i=1===t.length?$e.singular(r):r;kt(o,new Map([["label",`${t.length} ${i}`]]))}kt(Rt,Dt);const jt={show(){try{$t.hidden=!1}catch(e){console.error(e)}},hide(){$t.hidden=!0},enable(){Rt.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=we`<button id="${o}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}… - </button>`,s=ye`<li role="menuitem">${i}</li>`;return s.addEventListener("click",t),_t.appendChild(s),i},error(e){Pt(e,At,"error","ReSpec Errors")},warning(e){Pt(e,Lt,"warning","ReSpec Warnings")},closeModal(e){Ct&&(Ct.classList.remove("respec-show-overlay"),Ct.classList.add("respec-hide-overlay"),Ct.addEventListener("transitionend",(()=>{Ct.remove(),Ct=null}))),e&&e.setAttribute("aria-expanded","false"),St&&(St.remove(),St=null,Rt.focus())},freshModal(e,t,n){St&&St.remove(),Ct&&Ct.remove(),Ct=ye`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;St=ye`<div + </button>`,s=we`<li role="menuitem">${i}</li>`;return s.addEventListener("click",t),_t.appendChild(s),i},error(e){Pt(e,At,"error","ReSpec Errors")},warning(e){Pt(e,Lt,"warning","ReSpec Warnings")},closeModal(e){Ct&&(Ct.classList.remove("respec-show-overlay"),Ct.classList.add("respec-hide-overlay"),Ct.addEventListener("transitionend",(()=>{Ct.remove(),Ct=null}))),e&&e.setAttribute("aria-expanded","false"),St&&(St.remove(),St=null,Rt.focus())},freshModal(e,t,n){St&&St.remove(),Ct&&Ct.remove(),Ct=we`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;St=we`<div id="${r}" class="respec-modal removeOnSave" role="dialog" @@ -95,7 +95,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} ${Et} <h3 id="${o}">${e}</h3> <div class="inside">${t}</div> - </div>`;const i=new Map([["labelledby",o]]);kt(St,i),document.body.append(Ct,St),Ct.addEventListener("click",(()=>this.closeModal(n))),Ct.classList.toggle("respec-show-overlay"),St.hidden=!1,zt(St)}};function Ot(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${bt(`<p class="respec-hint"><strong>How to fix:</strong> ${_e(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${bt(e.elements.map(It).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${bt(`**${e.message}**`,{inline:!0})}${n}${r}${o}${t}`}function It(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function qt(e){try{jt.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await dt(e)}finally{jt.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&jt.closeModal()})),window.respecUI=jt,o("error",(e=>jt.error(e))),o("warn",(e=>jt.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const Mt=[Promise.resolve().then((function(){return Ft})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Ut})),Promise.resolve().then((function(){return Kt})),Promise.resolve().then((function(){return Gt})),Promise.resolve().then((function(){return sn})),Promise.resolve().then((function(){return xt})),Promise.resolve().then((function(){return Ee})),Promise.resolve().then((function(){return cn})),Promise.resolve().then((function(){return En})),Promise.resolve().then((function(){return An})),Promise.resolve().then((function(){return Ln})),Promise.resolve().then((function(){return Nn})),Promise.resolve().then((function(){return Fr})),Promise.resolve().then((function(){return Ur})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return ro})),Promise.resolve().then((function(){return ao})),Promise.resolve().then((function(){return fo})),Promise.resolve().then((function(){return wo})),Promise.resolve().then((function(){return xo})),Promise.resolve().then((function(){return lr})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return yr})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return tn})),Promise.resolve().then((function(){return Ho})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return ei})),Promise.resolve().then((function(){return ni})),Promise.resolve().then((function(){return ai})),Promise.resolve().then((function(){return fi})),Promise.resolve().then((function(){return hi})),Promise.resolve().then((function(){return xi})),Promise.resolve().then((function(){return Si})),Promise.resolve().then((function(){return Ni})),Promise.resolve().then((function(){return Di})),Promise.resolve().then((function(){return ji})),Promise.resolve().then((function(){return Hi})),Promise.resolve().then((function(){return Zi})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return ns})),Promise.resolve().then((function(){return ss})),Promise.resolve().then((function(){return us})),Promise.resolve().then((function(){return fs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return ys})),Promise.resolve().then((function(){return ks}))];Promise.all(Mt).then((e=>qt(e))).catch((e=>console.error(e)));var Ft=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash=`#${e}`}))}});const Bt={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Wt=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["cc-by-sa",{name:"Creative Commons Attribution-ShareAlike 4.0 International Public License",short:"CC-BY-SA",url:"https://creativecommons.org/licenses/by-sa/4.0/legalcode"}]]),Ht={format:"markdown",isED:!1,isNoTrack:!0,isPR:!1,lint:{"privsec-section":!0,"wpt-tests-exist":!1},logos:[],prependW3C:!1,doJsonLd:!1,license:"cc-by",shortName:"X",showPreviousVersion:!1};var Ut=Object.freeze({__proto__:null,name:"dini/defaults",run:function(e){const t=!1!==e.lint&&{...Bt.lint,...Ht.lint,...e.lint};Object.assign(e,{...Bt,...Ht,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:Wt.get(e.license)}}(e))}});var Vt=String.raw`@keyframes pop{ + </div>`;const i=new Map([["labelledby",o]]);kt(St,i),document.body.append(Ct,St),Ct.addEventListener("click",(()=>this.closeModal(n))),Ct.classList.toggle("respec-show-overlay"),St.hidden=!1,zt(St)}};function Ot(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${bt(`<p class="respec-hint"><strong>How to fix:</strong> ${_e(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${bt(e.elements.map(It).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${bt(`**${e.message}**`,{inline:!0})}${n}${r}${o}${t}`}function It(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function qt(e){try{jt.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await dt(e)}finally{jt.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&jt.closeModal()})),window.respecUI=jt,o("error",(e=>jt.error(e))),o("warn",(e=>jt.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const Mt=[Promise.resolve().then((function(){return Ft})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Ut})),Promise.resolve().then((function(){return Kt})),Promise.resolve().then((function(){return Gt})),Promise.resolve().then((function(){return sn})),Promise.resolve().then((function(){return xt})),Promise.resolve().then((function(){return Ee})),Promise.resolve().then((function(){return cn})),Promise.resolve().then((function(){return En})),Promise.resolve().then((function(){return An})),Promise.resolve().then((function(){return Ln})),Promise.resolve().then((function(){return Nn})),Promise.resolve().then((function(){return Fr})),Promise.resolve().then((function(){return Ur})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return ro})),Promise.resolve().then((function(){return ao})),Promise.resolve().then((function(){return ho})),Promise.resolve().then((function(){return yo})),Promise.resolve().then((function(){return xo})),Promise.resolve().then((function(){return lr})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return wr})),Promise.resolve().then((function(){return Ho})),Promise.resolve().then((function(){return tn})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return ei})),Promise.resolve().then((function(){return ni})),Promise.resolve().then((function(){return ai})),Promise.resolve().then((function(){return hi})),Promise.resolve().then((function(){return fi})),Promise.resolve().then((function(){return xi})),Promise.resolve().then((function(){return Si})),Promise.resolve().then((function(){return Ni})),Promise.resolve().then((function(){return Di})),Promise.resolve().then((function(){return ji})),Promise.resolve().then((function(){return Wi})),Promise.resolve().then((function(){return Zi})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return ns})),Promise.resolve().then((function(){return ss})),Promise.resolve().then((function(){return us})),Promise.resolve().then((function(){return hs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return ws})),Promise.resolve().then((function(){return ks}))];Promise.all(Mt).then((e=>qt(e))).catch((e=>console.error(e)));var Ft=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash=`#${e}`}))}});const Bt={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Ht=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["cc-by-sa",{name:"Creative Commons Attribution-ShareAlike 4.0 International Public License",short:"CC-BY-SA",url:"https://creativecommons.org/licenses/by-sa/4.0/legalcode"}]]),Wt={format:"markdown",isED:!1,isNoTrack:!0,isPR:!1,lint:{"privsec-section":!0,"wpt-tests-exist":!1},logos:[],prependW3C:!1,doJsonLd:!1,license:"cc-by",shortName:"X",showPreviousVersion:!1};var Ut=Object.freeze({__proto__:null,name:"dini/defaults",run:function(e){const t=!1!==e.lint&&{...Bt.lint,...Wt.lint,...e.lint};Object.assign(e,{...Bt,...Wt,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:Ht.get(e.license)}}(e))}});var Vt=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -150,14 +150,14 @@ dd{margin-left:0} } @media print{ .removeOnSave{display:none} -}`;const Zt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Vt,document.head.appendChild(e),e}();var Kt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Zt.remove()}});const Yt="dini/style";const Xt=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(Te))t.appendChild(n);return t}();Xt.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||Xt.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Xt);var Gt=Object.freeze({__proto__:null,name:Yt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",et(t,Yt)}let t="";switch(e.specStatus.toUpperCase()){case"UNOFFICIAL":t="W3C-UD";break;case"BASE":t="base.css"}e.noToc||o("end-all",(()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,n),o("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});class Qt{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Jt(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Jt(e){const t=new Qt(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function en(e){const t=Jt(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var tn=Object.freeze({__proto__:null,name:"core/sections",restructure:en,run:function(){en(document.body)}});const nn="core/data-include";function rn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=Ie(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=bt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&en(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function on(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);rn(await o.text(),r,n),t<3&&await on(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Je(r,nn,{elements:[e]})}}));await Promise.all(r)}var sn=Object.freeze({__proto__:null,name:nn,run:async function(){await on(document,1)}});const an="core/title",ln=Oe({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var cn=Object.freeze({__proto__:null,name:an,run:function(e){const t=document.querySelector("h1#title")||ye`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Je('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',an,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${ln.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=je(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=ye` +}`;const Zt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Vt,document.head.appendChild(e),e}();var Kt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Zt.remove()}});const Yt="dini/style";const Xt=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(Te))t.appendChild(n);return t}();Xt.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||Xt.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Xt);var Gt=Object.freeze({__proto__:null,name:Yt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",et(t,Yt)}let t="";switch(e.specStatus.toUpperCase()){case"UNOFFICIAL":t="W3C-UD";break;case"BASE":t="base.css"}e.noToc||o("end-all",(()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,n),o("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});class Qt{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Jt(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Jt(e){const t=new Qt(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function en(e){const t=Jt(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var tn=Object.freeze({__proto__:null,name:"core/sections",restructure:en,run:function(){en(document.body)}});const nn="core/data-include";function rn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=Ie(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=bt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&en(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function on(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);rn(await o.text(),r,n),t<3&&await on(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Je(r,nn,{elements:[e]})}}));await Promise.all(r)}var sn=Object.freeze({__proto__:null,name:nn,run:async function(){await on(document,1)}});const an="core/title",ln=Oe({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var cn=Object.freeze({__proto__:null,name:an,run:function(e){const t=document.querySelector("h1#title")||we`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Je('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',an,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${ln.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=je(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=we` Preview of PR <a href="${n}">#${e.prNumber}</a>: - `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function un(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return et(t,"core/templates/show-link"),void console.warn(t,e)}return ye` + `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function un(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return et(t,"core/templates/show-link"),void console.warn(t,e)}return we` <dt class="${e.class?e.class:null}">${e.key}</dt> ${e.data?e.data.map(dn):dn(e)} - `}function dn(e){return ye`<dd class="${e.class?e.class:null}"> - ${e.href?ye`<a href="${e.href}">${e.value||e.href}</a>`:e.value} - </dd>`}const pn="core/templates/show-logo";function fn(e,t){const n=ye`<a href="${e.url||null}" class="logo" + `}function dn(e){return we`<dd class="${e.class?e.class:null}"> + ${e.href?we`<a href="${e.href}">${e.value||e.href}</a>`:e.value} + </dd>`}const pn="core/templates/show-logo";function hn(e,t){const n=we`<a href="${e.url||null}" class="logo" ><img alt="${e.alt||null}" crossorigin @@ -166,7 +166,7 @@ dd{margin-left:0} src="${e.src||null}" width="${e.width||null}" /> - </a>`;if(!e.alt){const r=rt`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Je(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,pn,{hint:r,elements:[n]})}if(!e.src){const e=rt`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Je(`Logo at index ${t} is missing "\`src\`" property.`,pn,{hint:e,elements:[n]})}return n}const hn="core/templates/show-people",mn=Oe({en:{until:e=>ye` Until ${e} `},es:{until:e=>ye` Hasta ${e} `},ko:{until:e=>ye` ${e} 이전 `},ja:{until:e=>ye` ${e} 以前 `},de:{until:e=>ye` bis ${e} `},zh:{until:e=>ye` 直到 ${e} `}});function gn(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,i=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Je(`${i} Missing required property \`"name"\`.`,hn,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${i} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Je(n,hn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Je(`${i} ORCID "${o}" has wrong format.`,hn,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=(12-e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0)%11)%11,r=10===n?"X":String(n);return t===r}(n))return Je(`${i} ORCID "${n}" failed checksum check.`,hn,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(s=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(s)?new Date(s):"Invalid Date").toString())?(Je(`${i} The property "\`retiredDate\`" is not a valid date.`,hn,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return Je(`${n}. Member "extra" at index ${r} is not an object.`,hn,{hint:t}),!1;case!e.hasOwnProperty("name"):return Je(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,hn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Je(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,hn,{hint:t}),!1}return!0})):(Je(`${n}. A person's "extras" member must be an array.`,hn,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&et(`${i} Has both "url" and "mailto" property.`,hn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&et(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,hn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var s});var o;return n.filter(r).map(bn)}function bn(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(ye`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(ye`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(ye`<a class="p-name orcid" href="${e.orcid}">${ye`<svg + </a>`;if(!e.alt){const r=rt`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Je(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,pn,{hint:r,elements:[n]})}if(!e.src){const e=rt`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Je(`Logo at index ${t} is missing "\`src\`" property.`,pn,{hint:e,elements:[n]})}return n}const fn="core/templates/show-people",mn=Oe({en:{until:e=>we` Until ${e} `},es:{until:e=>we` Hasta ${e} `},ko:{until:e=>we` ${e} 이전 `},ja:{until:e=>we` ${e} 以前 `},de:{until:e=>we` bis ${e} `},zh:{until:e=>we` 直到 ${e} `}});function gn(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,i=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Je(`${i} Missing required property \`"name"\`.`,fn,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${i} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Je(n,fn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Je(`${i} ORCID "${o}" has wrong format.`,fn,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=(12-e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0)%11)%11,r=10===n?"X":String(n);return t===r}(n))return Je(`${i} ORCID "${n}" failed checksum check.`,fn,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(s=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(s)?new Date(s):"Invalid Date").toString())?(Je(`${i} The property "\`retiredDate\`" is not a valid date.`,fn,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return Je(`${n}. Member "extra" at index ${r} is not an object.`,fn,{hint:t}),!1;case!e.hasOwnProperty("name"):return Je(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,fn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Je(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,fn,{hint:t}),!1}return!0})):(Je(`${n}. A person's "extras" member must be an array.`,fn,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&et(`${i} Has both "url" and "mailto" property.`,fn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&et(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,fn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var s});var o;return n.filter(r).map(bn)}function bn(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(we`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(we`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(we`<a class="p-name orcid" href="${e.orcid}">${we`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" @@ -185,15 +185,15 @@ dd{margin-left:0} class="st1" d="M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z" /> -</svg>`}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?ye`<a class="${t}" href="${e.companyURL}">${n}</a>`:ye`<span class="${t}">${n}</span>`;o.push(ye` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>ye`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?ye`<a href="${r}" class="${t}">${n}</a>`:ye`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:i}=e;if(e.retiredDate){const e=ye`<time datetime="${i}" +</svg>`}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?we`<a class="${t}" href="${e.companyURL}">${n}</a>`:we`<span class="${t}">${n}</span>`;o.push(we` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>we`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?we`<a href="${r}" class="${t}">${n}</a>`:we`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:i}=e;if(e.retiredDate){const e=we`<time datetime="${i}" >${Le.format(new Date(i))}</time - >`;o.push(ye` - ${mn.until(e)} `)}return ye`<dd + >`;o.push(we` - ${mn.until(e)} `)}return we`<dd class="editor p-author h-card vcard" data-editor-id="${r}" > ${o} - </dd>`}const wn="dini/templates/headers",yn="https://creativecommons.org/licenses/by/4.0/legalcode",vn=Oe({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",this_version:"This version:"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",editor:"编辑:",editors:"编辑:",former_editor:"原编辑:",former_editors:"原编辑:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",this_version:"本版本:"},ja:{author:"著者:",authors:"著者:",editor:"編者:",editors:"編者:",former_editor:"以前の版の編者:",former_editors:"以前の版の編者:",latest_editors_draft:"最新の編集用草案:",latest_published_version:"最新バージョン:",this_version:"このバージョン:"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{author:"Autor:",authors:"Autores:",editor:"Editor:",editors:"Editores:",latest_editors_draft:"Borrador de editor mas reciente:",latest_published_version:"Versión publicada mas reciente:",this_version:"Ésta versión:"},de:{author:"Autor/in:",authors:"Autor/innen:",editor:"Redaktion:",editors:"Redaktion:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",this_version:"Diese Fassung:"}});var xn=e=>ye`<div class="head"> - ${e.logos.map(fn)} ${document.querySelector("h1#title")} + </dd>`}const yn="dini/templates/headers",wn="https://creativecommons.org/licenses/by/4.0/legalcode",vn=Oe({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",this_version:"This version:"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",editor:"编辑:",editors:"编辑:",former_editor:"原编辑:",former_editors:"原编辑:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",this_version:"本版本:"},ja:{author:"著者:",authors:"著者:",editor:"編者:",editors:"編者:",former_editor:"以前の版の編者:",former_editors:"以前の版の編者:",latest_editors_draft:"最新の編集用草案:",latest_published_version:"最新バージョン:",this_version:"このバージョン:"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{author:"Autor:",authors:"Autores:",editor:"Editor:",editors:"Editores:",latest_editors_draft:"Borrador de editor mas reciente:",latest_published_version:"Versión publicada mas reciente:",this_version:"Ésta versión:"},de:{author:"Autor/in:",authors:"Autor/innen:",editor:"Redaktion:",editors:"Redaktion:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",this_version:"Diese Fassung:"}});var xn=e=>we`<div class="head"> + ${e.logos.map(hn)} ${document.querySelector("h1#title")} ${function(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}(e)} <h2> ${e.textStatus} @@ -204,79 +204,79 @@ dd{margin-left:0} <dl> <dt>${e.multipleEditors?vn.editors:vn.editor}</dt> ${gn(e,"editors")} - ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?ye` + ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?we` <dt> ${e.multipleFormerEditors?vn.former_editors:vn.former_editor} </dt> ${gn(e,"formerEditors")} `:""} - ${e.authors?ye` + ${e.authors?we` <dt>${e.multipleAuthors?vn.authors:vn.author}</dt> ${gn(e,"authors")} `:""} ${e.otherLinks?e.otherLinks.map(un):""} </dl> - ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.hasOwnProperty("overrideCopyright")){et("The `overrideCopyright` configuration option is deprecated.",wn,{hint:'Please use `<p class="copyright">` instead.'})}return e.overrideCopyright?[e.overrideCopyright]:ye`<p class="copyright"> + ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.hasOwnProperty("overrideCopyright")){et("The `overrideCopyright` configuration option is deprecated.",yn,{hint:'Please use `<p class="copyright">` instead.'})}return e.overrideCopyright?[e.overrideCopyright]:we`<p class="copyright"> Dieses Dokument ist lizensiert unter - ${n="Creative Commons Attribution 4.0 International Public License",r=yn,o="subfoot",ye`<a rel="license" href="${r}" class="${o}">${n}</a>`}. + ${n="Creative Commons Attribution 4.0 International Public License",r=wn,o="subfoot",we`<a rel="license" href="${r}" class="${o}">${n}</a>`}. </p>`;var n,r,o}(e)} <hr /> - </div>`;const kn="dini/headers",$n=new Intl.DateTimeFormat(["de-DE"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"}),_n={unofficial:"Entwurf vom",base:"Spezifikation vom"};var En=Object.freeze({__proto__:null,name:kn,run:function(e){if(e.isUnofficial="unofficial"===e.specStatus,e.isBasic="base"===e.specStatus,!e.specStatus){Je("Missing required configuration: `specStatus`",kn)}e.title=document.title||"Kein Titel",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Ce.format(r);return new Date(e)}return Je(`[\`${t}\`](https://github.com/w3c/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,kn),new Date(Ce.format(new Date))}(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=$n.format(e.publishDate);const t=function(e){if(!e.name){Je("All authors and editors must have a name.",kn)}if(e.orcid)try{e.orcid=function(e){const t=new URL(e,"https://orcid.org/");if("https://orcid.org"!==t.origin)throw new Error(`The origin should be "https://orcid.org", not "${t.origin}".`);const n=t.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(n))throw new Error(`ORCIDs have the format "1234-1234-1234-1234", not "${n}"`);const r=n[n.length-1],o=(12-n.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0)%11)%11,i=10===o?"X":String(o);if(r!==i)throw new Error(`"${n}" has an invalid checksum.`);return t.href}(e.orcid)}catch(t){Je(`"${e.orcid}" is not an ORCID. ${t.message}`,kn),delete e.orcid}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}if(!e.editors||0===e.editors.length){Je("At least one editor is required",kn)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,(e.alternateFormats||[]).forEach((e=>{if(!e.uri||!e.label){Je("All alternate formats must have a uri and a label.",kn)}})),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=_n[e.specStatus],e.dashDate=Ce.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=xn(e);document.body.prepend(n),document.body.classList.add("h-entry"),r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const Sn="dini/abstract",Cn=Oe({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var An=Object.freeze({__proto__:null,name:Sn,run:async function(){const e=document.getElementById("abstract");if(!e){return void Je('Document must have one element with `id="abstract"',Sn)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=Cn.abstract,e.prepend(t))}});var Ln=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Ie(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Tn="core/dfn-abbr";function Rn(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var Nn=Object.freeze({__proto__:null,name:Tn,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Rn(t);else{Je(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Tn,{elements:[t],title:"Error: unsupported."})}}}});const zn=/^[a-z]+(\s+[a-z]+)+\??$/,Dn=/\B"([^"]*)"\B/,Pn=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,jn=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,On=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,In=/^(?:\w+)\??$/,qn=/^(\w+)\["([\w- ]*)"\]$/,Mn=/\.?(\w+\(.*\)$)/,Fn=/\/(.+)/,Bn=/\[\[.+\]\]/;function Wn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return ye`<a + </div>`;const kn="dini/headers",$n=new Intl.DateTimeFormat(["de-DE"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"}),_n={unofficial:"Entwurf vom",base:"Spezifikation vom"};var En=Object.freeze({__proto__:null,name:kn,run:function(e){if(e.isUnofficial="unofficial"===e.specStatus,e.isBasic="base"===e.specStatus,!e.specStatus){Je("Missing required configuration: `specStatus`",kn)}e.title=document.title||"Kein Titel",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Ce.format(r);return new Date(e)}return Je(`[\`${t}\`](https://github.com/w3c/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,kn),new Date(Ce.format(new Date))}(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=$n.format(e.publishDate);const t=function(e){if(!e.name){Je("All authors and editors must have a name.",kn)}if(e.orcid)try{e.orcid=function(e){const t=new URL(e,"https://orcid.org/");if("https://orcid.org"!==t.origin)throw new Error(`The origin should be "https://orcid.org", not "${t.origin}".`);const n=t.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(n))throw new Error(`ORCIDs have the format "1234-1234-1234-1234", not "${n}"`);const r=n[n.length-1],o=(12-n.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0)%11)%11,i=10===o?"X":String(o);if(r!==i)throw new Error(`"${n}" has an invalid checksum.`);return t.href}(e.orcid)}catch(t){Je(`"${e.orcid}" is not an ORCID. ${t.message}`,kn),delete e.orcid}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}if(!e.editors||0===e.editors.length){Je("At least one editor is required",kn)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,(e.alternateFormats||[]).forEach((e=>{if(!e.uri||!e.label){Je("All alternate formats must have a uri and a label.",kn)}})),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=_n[e.specStatus],e.dashDate=Ce.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=xn(e);document.body.prepend(n),document.body.classList.add("h-entry"),r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const Sn="dini/abstract",Cn=Oe({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var An=Object.freeze({__proto__:null,name:Sn,run:async function(){const e=document.getElementById("abstract");if(!e){return void Je('Document must have one element with `id="abstract"',Sn)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=Cn.abstract,e.prepend(t))}});var Ln=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Ie(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Tn="core/dfn-abbr";function Rn(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var Nn=Object.freeze({__proto__:null,name:Tn,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Rn(t);else{Je(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Tn,{elements:[t],title:"Error: unsupported."})}}}});const zn=/^[a-z]+(\s+[a-z]+)+\??$/,Dn=/\B"([^"]*)"\B/,Pn=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,jn=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,On=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,In=/^(?:\w+)\??$/,qn=/^(\w+)\["([\w- ]*)"\]$/,Mn=/\.?(\w+\(.*\)$)/,Fn=/\/(.+)/,Bn=/\[\[.+\]\]/;function Hn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return we`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></a - >`}function Hn(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:s}=n||{},a="method"===r,l=a?ye`(${qe(i,Un)})`:null,c=a?`(${i.join(", ")})`:"";return ye`${n&&o?".":""}<a + >`}function Wn(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:s}=n||{},a="method"===r,l=a?we`(${qe(i,Un)})`:null,c=a?`(${i.join(", ")})`:"";return we`${n&&o?".":""}<a data-xref-type="${r}" data-link-type="${r}" data-link-for="${s}" data-xref-for="${s}" data-lt="${`[[${t}]]${c}`}" ><code>[[${t}]]${l}</code></a - >`}function Un(e,t,n){if(t<n.length-1)return ye`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return ye`${o?"...":null}<var>${i}</var>`}function Vn(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return ye`${r?".":""}<a + >`}function Un(e,t,n){if(t<n.length-1)return we`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return we`${o?"...":null}<var>${i}</var>`}function Vn(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return we`${r?".":""}<a data-link-type="idl" data-xref-type="attribute|dict-member|const" data-link-for="${o}" data-xref-for="${o}" ><code>${n}</code></a - >`}function Zn(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{renderText:s,renderArgs:a}=e,{identifier:l}=o||{},c=qe(a||t,Un),u=`${n}(${t.join(", ")})`;return ye`${o&&i?".":""}<a + >`}function Zn(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{renderText:s,renderArgs:a}=e,{identifier:l}=o||{},c=qe(a||t,Un),u=`${n}(${t.join(", ")})`;return we`${o&&i?".":""}<a data-link-type="idl" data-xref-type="${r}" data-link-for="${l}" data-xref-for="${l}" data-lt="${u}" ><code>${s||n}</code></a - >${!s||a?ye`<code>(${c})</code>`:""}`}function Kn(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return ye`"<a + >${!s||a?we`<code>(${c})</code>`:""}`}function Kn(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return we`"<a data-link-type="idl" data-xref-type="enum-value" data-link-for="${o}" data-xref-for="${o}" data-lt="${n?null:"the-empty-string"}" ><code>${n}</code></a - >"`}function Yn(e){const{identifier:t}=e;return ye`"<a + >"`}function Yn(e){const{identifier:t}=e;return we`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function Xn(e){const{identifier:t,nullable:n}=e;return ye`<a + >"`}function Xn(e){const{identifier:t,nullable:n}=e;return we`<a data-link-type="idl" data-cite="webidl" data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function Gn(e){let t;try{t=function(e){const t=Bn.test(e),n=t?Fn:Mn,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),s=!e.includes("/"),a=[];for(;i.length;){const t=i.pop();if(Pn.test(t)){const[,e,n,r,o]=t.match(Pn),i=n.split(/,\s*/).filter((e=>e)),l=r?.trim(),c=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:i,renderParent:s,renderText:l,renderArgs:c})}else if(qn.test(t)){const[,e,n]=t.match(qn);a.push({type:"enum",identifier:e,enumValue:n,renderParent:s})}else if(Dn.test(t)){const[,e]=t.match(Dn);s?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:s})}else if(jn.test(t)){const[,e,n]=t.match(jn),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:s})}else if(On.test(t)&&i.length){const[,e]=t.match(On);a.push({type:"attribute",identifier:e,renderParent:s})}else if(zn.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:s,nullable:e})}else{if(!In.test(t)||0!==i.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:s,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=ye`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Je(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=ye(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Wn(e);t&&r.push(t);break}case"attribute":r.push(Vn(e));break;case"internal-slot":r.push(Hn(e));break;case"method":r.push(Zn(e));break;case"enum":r.push(Kn(e));break;case"exception":r.push(Yn(e));break;case"idl-primitive":r.push(Xn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Qn=new Set(["alias","reference"]),Jn=async function(){const e=await ve.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map((t=>e.deleteObjectStore(t)));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...Qn]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let i=await r.openCursor(o);for(;i?.value;){const e=i.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),i=await i.continue()}}return e}();const er={get ready(){return Jn},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Qn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Qn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Qn].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Qn.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){if((await this.get(e,t.id))?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Qn],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},tr={},nr=new URL("https://api.specref.org/bibrefs?refs="),rr=Te({hint:"dns-prefetch",href:nr.origin});let or;document.head.appendChild(rr);const ir=new Promise((e=>{or=e}));async function sr(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(nr.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),i=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),i):i;await er.addAll(o,e)}catch(e){console.error(e)}return o}async function ar(e){const t=await ir;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await ar(n.aliasOf):n}var lr=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=tr;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await er.ready;const n=e.map((async e=>({id:e,data:await er.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{tr[e.id]=e.data}));const i=o.noData.map((e=>e.id));if(i.length){const e=await sr(i,{forceUpdate:!0});Object.assign(tr,e)}Object.assign(tr,this.conf.localBiblio),(()=>{or(this.conf.biblio)})()}},biblio:tr,name:"core/biblio",resolveRef:ar,updateFromNetwork:sr});const cr="core/render-biblio",ur=Oe({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"}}),dr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PER","W3C Proposed Edited Recommendation"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),pr=(fr=".",e=>{const t=e.trim();return!t||t.endsWith(fr)?t:t+fr});var fr;function hr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(mr)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),i=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),s=ye`<section> + >`}function Gn(e){let t;try{t=function(e){const t=Bn.test(e),n=t?Fn:Mn,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),s=!e.includes("/"),a=[];for(;i.length;){const t=i.pop();if(Pn.test(t)){const[,e,n,r,o]=t.match(Pn),i=n.split(/,\s*/).filter((e=>e)),l=r?.trim(),c=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:i,renderParent:s,renderText:l,renderArgs:c})}else if(qn.test(t)){const[,e,n]=t.match(qn);a.push({type:"enum",identifier:e,enumValue:n,renderParent:s})}else if(Dn.test(t)){const[,e]=t.match(Dn);s?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:s})}else if(jn.test(t)){const[,e,n]=t.match(jn),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:s})}else if(On.test(t)&&i.length){const[,e]=t.match(On);a.push({type:"attribute",identifier:e,renderParent:s})}else if(zn.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:s,nullable:e})}else{if(!In.test(t)||0!==i.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:s,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=we`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Je(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=we(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Hn(e);t&&r.push(t);break}case"attribute":r.push(Vn(e));break;case"internal-slot":r.push(Wn(e));break;case"method":r.push(Zn(e));break;case"enum":r.push(Kn(e));break;case"exception":r.push(Yn(e));break;case"idl-primitive":r.push(Xn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Qn=new Set(["alias","reference"]),Jn=async function(){const e=await ve.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map((t=>e.deleteObjectStore(t)));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...Qn]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let i=await r.openCursor(o);for(;i?.value;){const e=i.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),i=await i.continue()}}return e}();const er={get ready(){return Jn},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Qn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Qn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Qn].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Qn.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){if((await this.get(e,t.id))?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Qn],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},tr={},nr=new URL("https://api.specref.org/bibrefs?refs="),rr=Te({hint:"dns-prefetch",href:nr.origin});let or;document.head.appendChild(rr);const ir=new Promise((e=>{or=e}));async function sr(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(nr.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),i=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),i):i;await er.addAll(o,e)}catch(e){console.error(e)}return o}async function ar(e){const t=await ir;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await ar(n.aliasOf):n}var lr=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=tr;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await er.ready;const n=e.map((async e=>({id:e,data:await er.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{tr[e.id]=e.data}));const i=o.noData.map((e=>e.id));if(i.length){const e=await sr(i,{forceUpdate:!0});Object.assign(tr,e)}Object.assign(tr,this.conf.localBiblio),(()=>{or(this.conf.biblio)})()}},biblio:tr,name:"core/biblio",resolveRef:ar,updateFromNetwork:sr});const cr="core/render-biblio",ur=Oe({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"}}),dr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PER","W3C Proposed Edited Recommendation"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),pr=(hr=".",e=>{const t=e.trim();return!t||t.endsWith(hr)?t:t+hr});var hr;function fr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(mr)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),i=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),s=we`<section> <h3>${t}</h3> <dl class="bibliography">${i.map(br)}</dl> - </section>`;Me(s,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Je(`Reference "[${t}]" not found.`,cr,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),s}function mr(e){let t=tr[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Je(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,cr)}else n=t.aliasOf,t=tr[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function gr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=ye`<cite + </section>`;Me(s,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Je(`Reference "[${t}]" not found.`,cr,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),s}function mr(e){let t=tr[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Je(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,cr)}else n=t.aliasOf,t=tr[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function gr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=we`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?o:ye`[${o}]`}function br(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return ye` + >`;return t?o:we`[${o}]`}function br(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return we` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:wr(n)}:ye`<em class="respec-offending-element" + ${n?{html:yr(n)}:we`<em class="respec-offending-element" >${ur.reference_not_found}</em >`} </dd> - `}function wr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${pr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${dr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var yr=Object.freeze({__proto__:null,name:cr,renderInlineCitation:gr,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||ye`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(ye`<h1>${ur.references}</h1>`),r.classList.add("appendix"),n.length){const e=hr(n,ur.norm_references);r.appendChild(e)}if(t.length){const e=hr(t,ur.info_references);r.appendChild(e)}document.body.appendChild(r)}});const vr="core/inlines",xr={},kr=e=>new RegExp(e.map((e=>e.source)).join("|")),$r=Oe({en:{rfc2119Keywords:()=>kr([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY?\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>kr([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),_r=/(?:`[^`]+`)(?!`)/,Er=/(?:{{[^}]+\?*}})/,Sr=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Cr=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Ar=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Lr=/(?:\[=[^=]+=\])/,Tr=/(?:\[\^[^^]+\^\])/;function Rr(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,s,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return ye`<code + `}function yr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${pr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${dr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var wr=Object.freeze({__proto__:null,name:cr,renderInlineCitation:gr,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||we`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(we`<h1>${ur.references}</h1>`),r.classList.add("appendix"),n.length){const e=fr(n,ur.norm_references);r.appendChild(e)}if(t.length){const e=fr(t,ur.info_references);r.appendChild(e)}document.body.appendChild(r)}});const vr="core/inlines",xr={},kr=e=>new RegExp(e.map((e=>e.source)).join("|")),$r=Oe({en:{rfc2119Keywords:()=>kr([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY?\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>kr([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),_r=/(?:`[^`]+`)(?!`)/,Er=/(?:{{[^}]+\?*}})/,Sr=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Cr=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Ar=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Lr=/(?:\[=[^=]+=\])/,Tr=/(?:\[\^[^^]+\^\])/;function Rr(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,s,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return we`<code ><a data-xref-type="${i}" data-xref-for="${s}" @@ -284,19 +284,19 @@ dd{margin-left:0} data-link-for="${s}" >${a}</a ></code - >`}function Nr(e){const t=je(e),n=ye`<em class="rfc2119">${t}</em>`;return xr[t]=!0,n}function zr(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?ye`<a href="${t}" data-matched-text="${e}"></a>`:ye`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Dr(e,t){const n=je(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Gn(n);return!!t.parentElement.closest("dfn")?qr(`\`${r.textContent}\``):r}function Pr(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(je),{type:s,illegal:a}=We(o,t.parentElement),l=gr(o,i),c=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;et("Normative references in informative sections are not allowed. ",vr,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==s||a?n.normativeReferences.add(c):n.informativeReferences.add(c),l.childNodes[1]?l.childNodes:[l]}function jr(e,t,n){return"ABBR"===t.parentElement.tagName?e:ye`<abbr title="${n.get(e)}">${e}</abbr>`}function Or(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return ye`<var data-type="${r}">${n}</var>`}function Ir(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(je).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),i=n.substring(r+1,n.length);return[t(o),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],s=Mr(i),a=n?je(n):null;return ye`<a + >`}function Nr(e){const t=je(e),n=we`<em class="rfc2119">${t}</em>`;return xr[t]=!0,n}function zr(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?we`<a href="${t}" data-matched-text="${e}"></a>`:we`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Dr(e,t){const n=je(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Gn(n);return!!t.parentElement.closest("dfn")?qr(`\`${r.textContent}\``):r}function Pr(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(je),{type:s,illegal:a}=He(o,t.parentElement),l=gr(o,i),c=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;et("Normative references in informative sections are not allowed. ",vr,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==s||a?n.normativeReferences.add(c):n.informativeReferences.add(c),l.childNodes[1]?l.childNodes:[l]}function jr(e,t,n){return"ABBR"===t.parentElement.tagName?e:we`<abbr title="${n.get(e)}">${e}</abbr>`}function Or(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return we`<var data-type="${r}">${n}</var>`}function Ir(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(je).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),i=n.substring(r+1,n.length);return[t(o),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],s=Mr(i),a=n?je(n):null;return we`<a data-link-type="dfn" data-link-for="${a}" data-xref-for="${a}" data-lt="${o}" >${s}</a - >`}function qr(e){const t=e.slice(1,-1);return ye`<code>${t}</code>`}function Mr(e){return _r.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?qr(e):Mr(e))):document.createTextNode(e)}var Fr=Object.freeze({__proto__:null,name:vr,rfc2119Usage:xr,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ze,e.informativeReferences=new Ze,e.respecRFC2119||(e.respecRFC2119=xr);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=je(e),o=je(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),i=[];let s;for(;s=o.nextNode();)i.push(s);return i}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),i=$r.rfc2119Keywords(),s=new RegExp(`(${kr([i,Er,Sr,Cr,Ar,Lr,_r,Tr,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(s);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const s of r)if(a=!a,a)switch(!0){case s.startsWith("{{"):o.append(Dr(s,n));break;case s.startsWith("[[["):o.append(zr(s));break;case s.startsWith("[["):o.append(...Pr(s,n,e));break;case s.startsWith("|"):o.append(Or(s));break;case s.startsWith("[="):o.append(Ir(s));break;case s.startsWith("`"):o.append(qr(s));break;case s.startsWith("[^"):o.append(Rr(s));break;case t.has(s):o.append(jr(s,n,t));break;case i.test(s):o.append(Nr(s))}else o.append(s);n.replaceWith(o)}}});const Br="dini/conformance",Wr=Oe({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>ye`<p> + >`}function qr(e){const t=e.slice(1,-1);return we`<code>${t}</code>`}function Mr(e){return _r.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?qr(e):Mr(e))):document.createTextNode(e)}var Fr=Object.freeze({__proto__:null,name:vr,rfc2119Usage:xr,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ze,e.informativeReferences=new Ze,e.respecRFC2119||(e.respecRFC2119=xr);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=je(e),o=je(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),i=[];let s;for(;s=o.nextNode();)i.push(s);return i}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),i=$r.rfc2119Keywords(),s=new RegExp(`(${kr([i,Er,Sr,Cr,Ar,Lr,_r,Tr,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(s);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const s of r)if(a=!a,a)switch(!0){case s.startsWith("{{"):o.append(Dr(s,n));break;case s.startsWith("[[["):o.append(zr(s));break;case s.startsWith("[["):o.append(...Pr(s,n,e));break;case s.startsWith("|"):o.append(Or(s));break;case s.startsWith("[="):o.append(Ir(s));break;case s.startsWith("`"):o.append(qr(s));break;case s.startsWith("[^"):o.append(Rr(s));break;case t.has(s):o.append(jr(s,n,t));break;case i.test(s):o.append(Nr(s))}else o.append(s);n.replaceWith(o)}}});const Br="dini/conformance",Hr=Oe({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>we`<p> The key word${t?"s":""} ${e} in this document ${t?"are":"is"} to be interpreted as described in <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> ${gr("RFC2119")} ${gr("RFC8174")} when, and only when, they appear in all capitals, as shown here. - </p>`},de:{conformance:"Anforderungen",normativity:"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument nicht normativ. Alle anderen Angaben sind normativ.",keywordInterpretation:(e,t)=>ye`<p> + </p>`},de:{conformance:"Anforderungen",normativity:"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument nicht normativ. Alle anderen Angaben sind normativ.",keywordInterpretation:(e,t)=>we`<p> ${t?"Die Schlüsselwörter":"Das Schlüsselwort"} ${e} in diesem Dokument ${t?"sind":"ist"} gemäß <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> @@ -307,22 +307,22 @@ dd{margin-left:0} > zu interpretieren, wenn und nur wenn ${t?"sie":"es"} wie hier gezeigt durchgehend groß geschrieben wurde${t?"n":""}. - </p>`}});function Hr(e,t){const n=[...Object.keys(xr)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(ze(o,(e=>ye`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?ye`${e}`:e)));var o;const i=n.length>1,s=ye` - <h1>${Wr.conformance}</h1> - <p>${Wr.normativity}</p> - ${n.length?Wr.keywordInterpretation(r,i):null} - `;e.prepend(...s.childNodes)}var Ur=Object.freeze({__proto__:null,name:Br,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Hr(t,e),!t&&Object.keys(xr).length){et("Document uses RFC2119 keywords but lacks a conformance section.",Br,{hint:'Please add a `<section id="conformance">`.'})}}});function Vr(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Je(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Zr(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Je(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Kr=new Ge;function Yr(e,t){for(const n of t)Kr.has(n)||Kr.set(n,new Set),Kr.get(n).add(e)}const Xr="core/dfn",Gr=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Zr}],["element",{requiresFor:!1,validator:Vr}],["element-attr",{requiresFor:!1,validator:Vr}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Zr}],["event",{requiresFor:!1,validator:Zr}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new ke(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Je(`Invalid ${t} "${e}": ${o.message}.`,r,{hint:"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:Zr}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Zr(e.slice(1,-1),t,n,r):(Je(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Qr=[...Gr.keys()];function Jr(e,t){let n="";switch(!0){case Qr.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Gr.has(e))),function(e,t,n){const r=Gr.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=rt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=rt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Je(e,Xr,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,Xr)}(t,n,e);break;case jn.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=rt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Je(`Internal slot "${e}" must be associated with a WebIDL interface.`,Xr,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const o=["attribute","method"],{dfnType:i}=t.dataset;if(!o.includes(i)||r!==i){const n=rt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${nt(o,{quotes:!0})}. The slot "${e}" seems to be a "${tt(r)}"?`;return Je(n,Xr,{hint:i,elements:[t]}),"dfn"}return i}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){n=e.closest("[data-dfn-type]")?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function eo(e){switch(!0){case e.matches(".export.no-export"):Je(rt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Xr,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Je(rt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Xr,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}function to(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}var no=Object.freeze({__proto__:null,name:Xr,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Fe(e);if(Yr(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Jr(e,n),eo(e),1===t.length&&n===je(e.textContent)||(e.dataset.lt=t.join("|"))}o("plugins-done",to)}});var ro=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=je(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set;return document.querySelectorAll("dfn:not([data-lt-noDefault])").forEach((e=>{const n=je(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=je(n).toLowerCase(),o=$e.isSingular(r)?$e.plural(r):$e.singular(r);return e.has(o)&&!t.has(o)?o:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),Yr(e,n)}}))}});var oo=String.raw`span.example-title{text-transform:none} + </p>`}});function Wr(e,t){const n=[...Object.keys(xr)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(ze(o,(e=>we`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?we`${e}`:e)));var o;const i=n.length>1,s=we` + <h1>${Hr.conformance}</h1> + <p>${Hr.normativity}</p> + ${n.length?Hr.keywordInterpretation(r,i):null} + `;e.prepend(...s.childNodes)}var Ur=Object.freeze({__proto__:null,name:Br,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Wr(t,e),!t&&Object.keys(xr).length){et("Document uses RFC2119 keywords but lacks a conformance section.",Br,{hint:'Please add a `<section id="conformance">`.'})}}});function Vr(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Je(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Zr(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Je(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Kr=new Ge;function Yr(e,t){for(const n of t)Kr.has(n)||Kr.set(n,new Set),Kr.get(n).add(e)}const Xr="core/dfn",Gr=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Zr}],["element",{requiresFor:!1,validator:Vr}],["element-attr",{requiresFor:!1,validator:Vr}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Zr}],["event",{requiresFor:!1,validator:Zr}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new ke(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Je(`Invalid ${t} "${e}": ${o.message}.`,r,{hint:"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:Zr}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Zr(e.slice(1,-1),t,n,r):(Je(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Qr=[...Gr.keys()];function Jr(e,t){let n="";switch(!0){case Qr.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Gr.has(e))),function(e,t,n){const r=Gr.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=rt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=rt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Je(e,Xr,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,Xr)}(t,n,e);break;case jn.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=rt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Je(`Internal slot "${e}" must be associated with a WebIDL interface.`,Xr,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const o=["attribute","method"],{dfnType:i}=t.dataset;if(!o.includes(i)||r!==i){const n=rt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${nt(o,{quotes:!0})}. The slot "${e}" seems to be a "${tt(r)}"?`;return Je(n,Xr,{hint:i,elements:[t]}),"dfn"}return i}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){n=e.closest("[data-dfn-type]")?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function eo(e){switch(!0){case e.matches(".export.no-export"):Je(rt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Xr,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Je(rt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Xr,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}function to(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}var no=Object.freeze({__proto__:null,name:Xr,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Fe(e);if(Yr(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Jr(e,n),eo(e),1===t.length&&n===je(e.textContent)||(e.dataset.lt=t.join("|"))}o("plugins-done",to)}});var ro=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=je(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set;return document.querySelectorAll("dfn:not([data-lt-noDefault])").forEach((e=>{const n=je(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=je(n).toLowerCase(),o=$e.isSingular(r)?$e.plural(r):$e.singular(r);return e.has(o)&&!t.has(o)?o:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),Yr(e,n)}}))}});var oo=String.raw`span.example-title{text-transform:none} :is(aside,div).example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both} div.illegal-example{color:red} div.illegal-example p{color:#000} :is(aside,div).example{border-left-width:.5em;border-left-style:solid;border-color:#e0cb52;background:#fcfaee} aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff} -.example pre{background-color:rgba(0,0,0,.03)}`;const io=Oe({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function so(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?ye`<span class="example-title">: ${n.title}</span>`:"";return ye`<div class="marker"> +.example pre{background-color:rgba(0,0,0,.03)}`;const io=Oe({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function so(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?we`<span class="example-title">: ${n.title}</span>`:"";return we`<div class="marker"> <a class="self-link">${io.example}<bdi>${r}</bdi></a >${o} - </div>`}var ao=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;document.head.insertBefore(ye`<style> + </div>`}var ao=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;document.head.insertBefore(we`<style> ${oo} - </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=so(e,t,r);e.prepend(n);const i=Me(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${i}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const i=e.id?e.id:null;i&&e.removeAttribute("id");const s=so(e,n?0:t,r),a=ye`<div class="example" id="${i}"> + </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=so(e,t,r);e.prepend(n);const i=Me(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${i}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const i=e.id?e.id:null;i&&e.removeAttribute("id");const s=so(e,n?0:t,r),a=we`<div class="example" id="${i}"> ${s} ${e.cloneNode(!0)} </div>`;Me(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var lo=String.raw`.issue-label{text-transform:initial} .warning>p:first-child{margin-top:0} @@ -334,29 +334,29 @@ span.warning{padding:.1em .5em .15em} .warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em} li.task-list-item{list-style:none} input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} -.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const co="core/issues-notes",uo=Oe({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"}});function po(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),o=document.createElement("ul");e.forEach((e=>{const{type:i,displayType:s,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",s=t?o?uo.feature_at_risk:uo.issue:n?uo.warning:r?uo.editors_note:uo.note;return{type:i,displayType:s,isFeatureAtRisk:o}}(e),l="issue"===i,c="span"===e.localName,{number:u}=e.dataset,d={type:i,inline:c,title:e.title,number:r(e)};if(!c){const r=ye`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=ye`<div role="heading" class="${`${i}-title marker`}">${c}</div>`;Me(p,"h",i);let f,h=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):Me(r,"issue-container",d.number?`number-${d.number}`:""),l){if(void 0!==d.number&&(h+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return ye`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return ye`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(c.before(e),e.append(c)),c.classList.add("issue-number"),f=t.get(u),!f){et(`Failed to fetch issue number ${u}.`,co)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?ye`<span style="text-transform: none">: ${t.title}</span>`:"";return ye`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(uo.issue,d,r.id))}if(c.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=f?f.labels:[];f&&"CLOSED"===f.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const i=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,i,s]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*o+.7152*i+.0722*s>.179?"#000":"#fff"}(n),s=`GitHub label: ${r}`;return ye` <a +.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const co="core/issues-notes",uo=Oe({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"}});function po(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),o=document.createElement("ul");e.forEach((e=>{const{type:i,displayType:s,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",s=t?o?uo.feature_at_risk:uo.issue:n?uo.warning:r?uo.editors_note:uo.note;return{type:i,displayType:s,isFeatureAtRisk:o}}(e),l="issue"===i,c="span"===e.localName,{number:u}=e.dataset,d={type:i,inline:c,title:e.title,number:r(e)};if(!c){const r=we`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=we`<div role="heading" class="${`${i}-title marker`}">${c}</div>`;Me(p,"h",i);let h,f=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):Me(r,"issue-container",d.number?`number-${d.number}`:""),l){if(void 0!==d.number&&(f+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return we`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return we`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(c.before(e),e.append(c)),c.classList.add("issue-number"),h=t.get(u),!h){et(`Failed to fetch issue number ${u}.`,co)}h&&!d.title&&(d.title=h.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?we`<span style="text-transform: none">: ${t.title}</span>`:"";return we`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(uo.issue,d,r.id))}if(c.textContent=f,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=h?h.labels:[];h&&"CLOSED"===h.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const i=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,i,s]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*o+.7152*i+.0722*s>.179?"#000":"#fff"}(n),s=`GitHub label: ${r}`;return we` <a class="respec-gh-label" style="${`background-color: #${n}; color: ${i}`}" href="${o.href}" aria-label="${s}" >${r}</a - >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return ye`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(i),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=Ue(p,"section").length+2;p.setAttribute("aria-level",g)}})),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(ye`<p>${uo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${uo.issue_summary}</h1>`)}(o)}var fo=Object.freeze({__proto__:null,name:co,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter((e=>e instanceof HTMLElement));if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map((e=>Number.parseInt(e.dataset.number,10))).filter((e=>e));if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return Je(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,co),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(ye`<style> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return we`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(i),m.removeAttribute("data-number"),h&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(h.bodyHTML)),r.append(p,m);const g=Ue(p,"section").length+2;p.setAttribute("aria-level",g)}})),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(we`<p>${uo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${uo.issue_summary}</h1>`)}(o)}var ho=Object.freeze({__proto__:null,name:co,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter((e=>e instanceof HTMLElement));if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map((e=>Number.parseInt(e.dataset.number,10))).filter((e=>e));if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return Je(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,co),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(we`<style> ${lo} - </style>`,o.querySelector("link")),po(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const ho="core/best-practices",mo={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},go=Oe(mo),bo=l in mo?l:"en";var wo=Object.freeze({__proto__:null,name:ho,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=Me(e,"bp"),o=ye`<a class="marker self-link" href="${`#${r}`}" + </style>`,o.querySelector("link")),po(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const fo="core/best-practices",mo={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},go=Oe(mo),bo=l in mo?l:"en";var yo=Object.freeze({__proto__:null,name:fo,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=Me(e,"bp"),o=we`<a class="marker self-link" href="${`#${r}`}" ><bdi lang="${bo}">${go.best_practice}${t+1}</bdi></a - >`;if(n){const t=ye`<li>${o}: ${Ke(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=ye`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(ye`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){et("Using best practices summary (#bp-summary) but no best practices found.",ho),t.remove()}}});const yo="core/figures",vo=Oe({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var xo=Object.freeze({__proto__:null,name:yo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;Me(e,"fig",r),He(t,ye`<span class="fig-title"></span>`),t.prepend(ye`<a class="self-link" href="#${e.id}" + >`;if(n){const t=we`<li>${o}: ${Ke(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=we`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(we`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){et("Using best practices summary (#bp-summary) but no best practices found.",fo),t.remove()}}});const wo="core/figures",vo=Oe({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var xo=Object.freeze({__proto__:null,name:wo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;Me(e,"fig",r),We(t,we`<span class="fig-title"></span>`),t.prepend(we`<a class="self-link" href="#${e.id}" >${vo.fig}<bdi class="figno">${n+1}</bdi></a - >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Be(e,"span").removeAttribute("href")})),ye`<li class="tofline"> + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Be(e,"span").removeAttribute("href")})),we`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> - </li>`}(t.id,r));else{et("Found a `<figure>` without a `<figcaption>`.",yo,{elements:[t]})}})),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(ye`<h1>${vo.list_of_figures}</h1>`,ye`<ul class="tof"> + </li>`}(t.id,r));else{et("Found a `<figure>` without a `<figcaption>`.",wo,{elements:[t]})}})),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(we`<h1>${vo.list_of_figures}</h1>`,we`<ul class="tof"> ${e} - </ul>`))}});const ko="core/data-cite",$o="__SPEC__";async function _o(e){const{key:t,frag:n,path:r,href:o}=e;let i="",s="";if(t===$o)i=document.location.href;else{const e=await ar(t);if(!e)return null;i=e.href,s=e.title}if(o)i=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:s}}function Eo(e,t,n){const{href:r,title:o}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?He(e,t):(t.textContent=o,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Je("Exporting an linked external definition is not allowed.",ko,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function So(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Co=So("#"),Ao=So("/");function Lo(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:i}=r?Lo(r):{key:$o,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=n.replace("#",""),Lo(e)}const s=r?`#${r}`:Co(n),a=o||Ao(n).split("#")[0],{type:l}=We(n,e),c="normative"===l,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:c,frag:s,path:a,href:i}}function To(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var Ro=Object.freeze({__proto__:null,THIS_SPEC:$o,name:ko,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(Lo).map((async e=>({entry:e,result:await ar(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await sr(n);r&&Object.assign(tr,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Lo(t),r=await _o(n);if(r)Eo(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),et(n,ko,{elements:[t]})}}o("beforesave",To)},toCiteDetails:Lo});const No="core/link-to-dfn",zo=[],Do={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}},Po=Oe(Do);function jo(e){const t=new Map,n=[];for(const r of Kr.get(e)){const{dfnType:o="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const s of i){if(t.has(s)&&t.get(s).has(o)){const e=t.get(s).get(o),i="dfn"===e.localName,a="dfn"===r.localName,l=o===(e.dataset.dfnType||"dfn"),c=!s&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(s);if(i&&a&&l&&c){n.push(r);continue}}t.has(s)||t.set(s,new Map),t.get(s).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(s).set("idl",r),Me(r,"dfn",e)}}return{result:t,duplicates:n}}function Oo(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Fe(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const o=t.get(r.title).get(r.for),{linkType:i}=e.dataset;if(i)return o.get(i)||o.get("dfn");{const e=r.for?"idl":"dfn";return o.get(e)||o.get("idl")}}function Io(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&i&&!i.split(",").map((e=>e.trim())).includes(o))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),o=qo(e)&&qo(t,n);r&&!o||He(e,document.createElement("code"))}(e,t),!r}function qo(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function Mo(e){e.forEach((e=>{et(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,No,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var Fo=Object.freeze({__proto__:null,name:No,possibleExternalLinks:zo,run:async function(e){const t=function(){const e=new Ge;for(const t of Kr.keys()){const{result:n,duplicates:r}=jo(t);e.set(t,n),r.length>0&&Je(Po.duplicateMsg(t),No,{title:Po.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){zo.push(e);continue}const r=Oo(e,t);if(r){Io(e,r,t)||zo.push(e)}else""===e.dataset.cite?n.push(e):zo.push(e)}Mo(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:o}=Lo(t);r!==$o&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Mo(zo)}});const Bo="core/contrib";var Wo=Object.freeze({__proto__:null,name:Bo,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Je(rt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Bo)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await o();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void ye(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=Pe(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,i;if("caches"in window)try{if(o=await caches.open(r.origin),i=await o.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const s=await fetch(n);if(!s.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&s.ok){const e=s.clone(),r=new Headers(s.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return s}(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return Je("Error loading contributors from GitHub.",Bo),console.error(e),null}}}(t,n)}});var Ho=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Be(e,`h${t}`)}))}});const Uo=["h2","h3","h4","h5","h6"],Vo="core/structure",Zo=Oe({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Ko(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=ye`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=i,r=!0);let e=a.isIntro?"":r?Yo(i-o+1):n+i;const l=e.split(".").length;if(1===l&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(ye`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Go(a.header,n),o=Ko(a.subsections,t,{prefix:e});o&&r.append(o),s.append(r)}}return s}function Yo(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Xo(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Uo.includes(r.localName))continue;const o=r.textContent;Me(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Xo(e)})}return n}function Go(e,t){const n=ye`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Be(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Be(e,"span").removeAttribute("id")})),ye`<li class="tocline">${n}</li>`}var Qo=Object.freeze({__proto__:null,name:Vo,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(Ue(e,"section").length+1,6)}`;e.localName!==t&&Be(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){Je("`data-max-toc` must have a value between 0-6 (inclusive).",Vo,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Ko(Xo(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=ye`<nav id="toc"></nav>`,n=ye`<h2 class="introductory">${Zo.toc}</h2>`;Me(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const o=ye`<p role="navigation" id="back-to-top"> + </ul>`))}});const ko="core/data-cite",$o="__SPEC__";async function _o(e){const{key:t,frag:n,path:r,href:o}=e;let i="",s="";if(t===$o)i=document.location.href;else{const e=await ar(t);if(!e)return null;i=e.href,s=e.title}if(o)i=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:s}}function Eo(e,t,n){const{href:r,title:o}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?We(e,t):(t.textContent=o,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Je("Exporting an linked external definition is not allowed.",ko,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function So(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Co=So("#"),Ao=So("/");function Lo(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:i}=r?Lo(r):{key:$o,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=n.replace("#",""),Lo(e)}const s=r?`#${r}`:Co(n),a=o||Ao(n).split("#")[0],{type:l}=He(n,e),c="normative"===l,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:c,frag:s,path:a,href:i}}function To(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var Ro=Object.freeze({__proto__:null,THIS_SPEC:$o,name:ko,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(Lo).map((async e=>({entry:e,result:await ar(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await sr(n);r&&Object.assign(tr,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Lo(t),r=await _o(n);if(r)Eo(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),et(n,ko,{elements:[t]})}}o("beforesave",To)},toCiteDetails:Lo});const No="core/link-to-dfn",zo=[],Do={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}},Po=Oe(Do);function jo(e){const t=new Map,n=[];for(const r of Kr.get(e)){const{dfnType:o="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const s of i){if(t.has(s)&&t.get(s).has(o)){const e=t.get(s).get(o),i="dfn"===e.localName,a="dfn"===r.localName,l=o===(e.dataset.dfnType||"dfn"),c=!s&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(s);if(i&&a&&l&&c){n.push(r);continue}}t.has(s)||t.set(s,new Map),t.get(s).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(s).set("idl",r),Me(r,"dfn",e)}}return{result:t,duplicates:n}}function Oo(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Fe(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const o=t.get(r.title).get(r.for),{linkType:i}=e.dataset;if(i)return o.get(i)||o.get("dfn");{const e=r.for?"idl":"dfn";return o.get(e)||o.get("idl")}}function Io(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&i&&!i.split(",").map((e=>e.trim())).includes(o))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),o=qo(e)&&qo(t,n);r&&!o||We(e,document.createElement("code"))}(e,t),!r}function qo(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function Mo(e){e.forEach((e=>{et(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,No,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var Fo=Object.freeze({__proto__:null,name:No,possibleExternalLinks:zo,run:async function(e){const t=function(){const e=new Ge;for(const t of Kr.keys()){const{result:n,duplicates:r}=jo(t);e.set(t,n),r.length>0&&Je(Po.duplicateMsg(t),No,{title:Po.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){zo.push(e);continue}const r=Oo(e,t);if(r){Io(e,r,t)||zo.push(e)}else""===e.dataset.cite?n.push(e):zo.push(e)}Mo(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:o}=Lo(t);r!==$o&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Mo(zo)}});const Bo="core/contrib";var Ho=Object.freeze({__proto__:null,name:Bo,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Je(rt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Bo)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await o();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void we(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=Pe(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,i;if("caches"in window)try{if(o=await caches.open(r.origin),i=await o.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const s=await fetch(n);if(!s.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&s.ok){const e=s.clone(),r=new Headers(s.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return s}(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return Je("Error loading contributors from GitHub.",Bo),console.error(e),null}}}(t,n)}});var Wo=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Be(e,`h${t}`)}))}});const Uo=["h2","h3","h4","h5","h6"],Vo="core/structure",Zo=Oe({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Ko(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=we`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=i,r=!0);let e=a.isIntro?"":r?Yo(i-o+1):n+i;const l=e.split(".").length;if(1===l&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(we`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Go(a.header,n),o=Ko(a.subsections,t,{prefix:e});o&&r.append(o),s.append(r)}}return s}function Yo(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Xo(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Uo.includes(r.localName))continue;const o=r.textContent;Me(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Xo(e)})}return n}function Go(e,t){const n=we`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Be(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Be(e,"span").removeAttribute("id")})),we`<li class="tocline">${n}</li>`}var Qo=Object.freeze({__proto__:null,name:Vo,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(Ue(e,"section").length+1,6)}`;e.localName!==t&&Be(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){Je("`data-max-toc` must have a value between 0-6 (inclusive).",Vo,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Ko(Xo(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=we`<nav id="toc"></nav>`,n=we`<h2 class="introductory">${Zo.toc}</h2>`;Me(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const o=we`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> - </p>`;document.body.append(o)}(t)}r("toc")}});const Jo=Oe({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"}});var ei=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(ye`<p><em>${Jo.informative}</em></p>`)}))}});const ti=Oe({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${je(t.textContent)}`),n}}});var ni=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(Me(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=ti.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=ye`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=ye`<a + </p>`;document.body.append(o)}(t)}r("toc")}});const Jo=Oe({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"}});var ei=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(we`<p><em>${Jo.informative}</em></p>`)}))}});const ti=Oe({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${je(t.textContent)}`),n}}});var ni=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(Me(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=ti.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=we`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=we`<a href="#${t}" class="self-link" aria-label="${r}" - ></a>`;o.append(n,i)}}});const ri="ui/save-html",oi=Oe({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),ii=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return it(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return it(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function si(e,t){const{id:n,href:r,ext:o,title:i,type:s}=e,a=function(e,t=""){return Ce.format(e).replace(Se,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return ye`<a + ></a>`;o.append(n,i)}}});const ri="ui/save-html",oi=Oe({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),ii=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return it(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return it(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function si(e,t){const{id:n,href:r,ext:o,title:i,type:s}=e,a=function(e,t=""){return Ce.format(e).replace(Se,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return we`<a href="${r}" id="${n}" download="${l}.${o}" @@ -364,9 +364,9 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} class="respec-save-button" onclick=${()=>jt.closeModal()} >${i}</a - >`}var ai=Object.freeze({__proto__:null,exportDocument:function(e,t){return et("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",ri,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),it(t)},name:ri,run:function(e){const t={async show(t){await document.respec.ready;const n=ye`<div class="respec-save-buttons"> + >`}var ai=Object.freeze({__proto__:null,exportDocument:function(e,t){return et("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",ri,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),it(t)},name:ri,run:function(e){const t={async show(t){await document.respec.ready;const n=we`<div class="respec-save-buttons"> ${ii.map((t=>si(t,e)))} - </div>`;jt.freshModal(oi.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=jt.addCommand(oi.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const li=Oe({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const ci=document.createElement("div"),ui=ye.bind(ci),di=jt.addCommand(`${li.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(pi).forEach((t=>{e.push(t)}));ui` + </div>`;jt.freshModal(oi.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=jt.addCommand(oi.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const li=Oe({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const ci=document.createElement("div"),ui=we.bind(ci),di=jt.addCommand(`${li.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(pi).forEach((t=>{e.push(t)}));ui` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -390,12 +390,12 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} </thead> <tbody>${e}</tbody> </table> -`,jt.freshModal(`${li.about_respec} - ${window.respecVersion}`,ci,di)}),"Ctrl+Shift+Alt+A","ℹ️");function pi({name:e,duration:t}){return ye` +`,jt.freshModal(`${li.about_respec} - ${window.respecVersion}`,ci,di)}),"Ctrl+Shift+Alt+A","ℹ️");function pi({name:e,duration:t}){return we` <tr> <td><a href="${`https://github.com/w3c/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}var fi=Object.freeze({__proto__:null});var hi=Object.freeze({__proto__:null,name:"core/seo",run:function(){const e=document.querySelector("#abstract p:first-of-type");if(!e)return;const t=e.textContent.replace(/\s+/," ").trim(),n=document.createElement("meta");n.name="description",n.content=t,document.head.appendChild(n)}});var mi=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa} + `}var hi=Object.freeze({__proto__:null});var fi=Object.freeze({__proto__:null,name:"core/seo",run:function(){const e=document.querySelector("#abstract p:first-of-type");if(!e)return;const t=e.textContent.replace(/\s+/," ").trim(),n=document.createElement("meta");n.name="description",n.content=t,document.head.appendChild(n)}});var mi=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa} .hljs-comment,.hljs-quote{color:#717277;font-style:italic} .hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4} .hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#ca4706;font-weight:700} @@ -406,7 +406,7 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} .hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3} .hljs-emphasis{font-style:italic} .hljs-strong{font-weight:700} -.hljs-link{text-decoration:underline}`;async function gi(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-dini.js",document.baseURI).href));return await t.text()}const bi=Te({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(bi);const wi=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return $s}))).default}catch{return gi("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",wi.then((e=>({worker:e}))));const yi=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function vi(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter((e=>"highlight"!==e&&"nolinks"!==e)).map((e=>e.toLowerCase())));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:yi(),languages:t},r=await wi;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(i){const{data:{id:s,language:a,value:l}}=i;s===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:l}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:i}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${i}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=i,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var xi=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n ")].filter((e=>"pre"!==e.localName||!e.querySelector("code")));if(!t.length)return;const n=t.filter((e=>e.textContent.trim())).map(vi);document.head.appendChild(ye`<style> +.hljs-link{text-decoration:underline}`;async function gi(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-dini.js",document.baseURI).href));return await t.text()}const bi=Te({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(bi);const yi=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return $s}))).default}catch{return gi("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",yi.then((e=>({worker:e}))));const wi=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function vi(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter((e=>"highlight"!==e&&"nolinks"!==e)).map((e=>e.toLowerCase())));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:wi(),languages:t},r=await yi;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(i){const{data:{id:s,language:a,value:l}}=i;s===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:l}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:i}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${i}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=i,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var xi=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n ")].filter((e=>"pre"!==e.localName||!e.querySelector("code")));if(!t.length)return;const n=t.filter((e=>e.textContent.trim())).map(vi);document.head.appendChild(we`<style> ${mi} </style>`),await Promise.all(n)}});const ki="core/list-sorter";function $i(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function _i(e,t){return[...e.querySelectorAll(":scope > li")].sort($i(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function Ei(e,t){return[...e.querySelectorAll(":scope > dt")].sort($i(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:i}=t;for(;i&&i.nextSibling;){o.appendChild(i.cloneNode(!0));const{nodeType:e,nodeName:t}=i.nextSibling;if(e===n&&t===r)break;i=i.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var Si=Object.freeze({__proto__:null,name:ki,run:function(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=Ei(t,n);break;case"ol":case"ul":e=_i(t,n);break;default:et(`ReSpec can't sort ${t.localName} elements.`,ki,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:Ei,sortListItems:_i});var Ci=String.raw`var:hover{text-decoration:underline;cursor:pointer} var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)} @@ -423,7 +423,7 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none} var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#000} var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#000;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400} -var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Di=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=zi,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}});var Pi=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var ji=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: ")));if(!e.length)return;for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(ye`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=Pi,document.head.appendChild(t)}});const Oi="core/anchor-expander";function Ii(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching element "${t}", but it has no title or marker.`,Oi,{title:"Missing title.",elements:[n]})}const o=Ke(r);n.append(...o.childNodes),n.classList.add("box-ref")}function qi(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Oi,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ke(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=je(i.textContent))}function Mi(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Oi,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ke(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=je(i.textContent))}function Fi(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Bi(r,n),Wi(r,n);else{n.textContent=n.getAttribute("href");Je("Found matching section, but the section was lacking a heading element.",Oi,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Bi(e,t){const n=e.querySelector(".self-link"),r=[...Ke(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Be(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Wi(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Hi=Object.freeze({__proto__:null,name:Oi,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":Bi(n,t);break;case"section":Fi(n,e,t);break;case"figure":qi(n,e,t);break;case"table":Mi(n,e,t);break;case"aside":case"div":Ii(n,e,t);break;default:t.textContent=t.getAttribute("href");Je("ReSpec doesn't support expanding this kind of reference.",Oi,{title:`Can't expand "#${e}".`,elements:[t]})}Wi(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Je(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Oi,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Ui=String.raw`dfn{cursor:pointer} +var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Di=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=zi,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}});var Pi=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var ji=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: ")));if(!e.length)return;for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(we`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=Pi,document.head.appendChild(t)}});const Oi="core/anchor-expander";function Ii(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching element "${t}", but it has no title or marker.`,Oi,{title:"Missing title.",elements:[n]})}const o=Ke(r);n.append(...o.childNodes),n.classList.add("box-ref")}function qi(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Oi,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ke(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=je(i.textContent))}function Mi(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Oi,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ke(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=je(i.textContent))}function Fi(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Bi(r,n),Hi(r,n);else{n.textContent=n.getAttribute("href");Je("Found matching section, but the section was lacking a heading element.",Oi,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Bi(e,t){const n=e.querySelector(".self-link"),r=[...Ke(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Be(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Hi(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Wi=Object.freeze({__proto__:null,name:Oi,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":Bi(n,t);break;case"section":Fi(n,e,t);break;case"figure":qi(n,e,t);break;case"table":Mi(n,e,t);break;case"aside":case"div":Ii(n,e,t);break;default:t.textContent=t.getAttribute("href");Je("ReSpec doesn't support expanding this kind of reference.",Oi,{title:`Can't expand "#${e}".`,elements:[t]})}Hi(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Je(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Oi,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Ui=String.raw`dfn{cursor:pointer} .dfn-panel{position:absolute;z-index:35;min-width:300px;max-width:500px;padding:.5em .75em;margin-top:.6em;font-family:"Helvetica Neue",sans-serif;font-size:small;background:#fff;color:#000;box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);border-radius:2px} .dfn-panel:not(.docked)>.caret{position:absolute;top:-9px} .dfn-panel:not(.docked)>.caret::after,.dfn-panel:not(.docked)>.caret::before{content:"";position:absolute;border:10px solid transparent;border-top:0;border-bottom:10px solid #fff;top:0} @@ -440,7 +440,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Di=Obje .dfn-panel a[href]:hover{border-bottom-width:1px} .dfn-panel ul{padding:0} .dfn-panel li{margin-left:1em} -.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Vi(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,i=e.getAttribute("aria-label")||je(e.textContent),s=ye` +.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Vi(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,i=e.getAttribute("aria-label")||je(e.textContent),s=we` <div class="dfn-panel" id="${o}" @@ -457,11 +457,11 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Di=Obje aria-label="Permalink for definition: ${i}. Activate to close this dialog." >Permalink</a > - ${function(e){return e.matches("dfn[data-export]")?ye`<span + ${function(e){return e.matches("dfn[data-export]")?we`<span class="marker dfn-exported" title="Definition can be referenced by other specifications" >exported</span - >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return ye`<a + >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return we`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -469,19 +469,19 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Di=Obje >`}}return null}(e,r)} </div> <p><b>Referenced in:</b></p> - ${function(e,t){if(!t.length)return ye`<ul> + ${function(e,t){if(!t.length)return we`<ul> <li>Not referenced in this document.</li> - </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const i=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`§ ${je(n.textContent)}`:null}(t);(n.get(i)||n.set(i,[]).get(i)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>ye`<li> - ${r(e).map((e=>ye`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} - </li>`;return ye`<ul> + </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const i=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`§ ${je(n.textContent)}`:null}(t);(n.get(i)||n.set(i,[]).get(i)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>we`<li> + ${r(e).map((e=>we`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} + </li>`;return we`<ul> ${[...n].map(o)} </ul>`}(t,r)} </div> - `;return s}var Zi=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(ye`<style> + `;return s}var Zi=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(we`<style> ${Ui} - </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Vi(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return _s}))).default}catch{return gi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Ki=new Promise(((e,t)=>{}));Oe({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});const Yi="rs-changelog",Xi=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;ye.bind(this)` + </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Vi(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return _s}))).default}catch{return gi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Ki=new Promise(((e,t)=>{}));Oe({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});const Yi="rs-changelog",Xi=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;we.bind(this)` <ul> - ${{any:Gi(e,t,n).then((e=>async function(e){const{repoURL:t}=await Ki;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,i=r&&ye` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return ye`<li><a href="${o}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>Je(e.message,Yi,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} + ${{any:Gi(e,t,n).then((e=>async function(e){const{repoURL:t}=await Ki;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,i=r&&we` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return we`<li><a href="${o}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>Je(e.message,Yi,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} </ul> - `}};async function Gi(e,t,n){let r;try{const o=await Ki;if(!o)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${o.apiBase}/${o.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const s=await fetch(i.href);if(!s.ok)throw new Error(`Request to ${i} failed with status code ${s.status}`);if(r=await s.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw console.error(e),new Error(t)}return r}const Qi=[Object.freeze({__proto__:null,element:Xi,name:Yi})];var Ji=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Qi.forEach((e=>{customElements.define(e.name,e.element)}));const e=Qi.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});const es="core/linter-rules/check-charset",ts=Oe({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var ns=Object.freeze({__proto__:null,name:es,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||et(ts.msg,es,{hint:ts.hint,elements:[...t]})}});const rs="core/linter-rules/check-punctuation",os=[".",":","!","?"],is=Oe({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${os.map((e=>`"${e}"`)).join(", ")}.`}});var ss=Object.freeze({__proto__:null,name:rs,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${os.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&et(is.msg,rs,{hint:is.hint,elements:n})}});const as="core/linter-rules/local-refs-exist",ls=Oe({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function cs(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var us=Object.freeze({__proto__:null,name:as,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(cs);t.length&&et(ls.msg,as,{hint:ls.hint,elements:t})}});const ds="core/linter-rules/no-headingless-sections",ps=Oe({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"}});var fs=Object.freeze({__proto__:null,name:ds,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&et(ps.msg,ds,{hint:ps.hint,elements:t})}});const hs="core/linter-rules/no-unused-vars",ms=Oe({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var gs=Object.freeze({__proto__:null,name:hs,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=je(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&et(ms.msg,hs,{hint:ms.hint,elements:t})}});const bs="core/linter-rules/privsec-section",ws=Oe({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var ys=Object.freeze({__proto__:null,name:bs,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&et(ws.msg,bs,{hint:ws.hint})}});const vs="core/linter-rules/no-http-props",xs=Oe({en:{msg:rt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:rt`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var ks=Object.freeze({__proto__:null,name:vs,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=Pe(t,(e=>rt`${`[${e}]`}`));et(xs.msg,vs,{hint:xs.hint+e})}}}),$s=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),_s=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); + `}};async function Gi(e,t,n){let r;try{const o=await Ki;if(!o)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${o.apiBase}/${o.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const s=await fetch(i.href);if(!s.ok)throw new Error(`Request to ${i} failed with status code ${s.status}`);if(r=await s.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw console.error(e),new Error(t)}return r}const Qi=[Object.freeze({__proto__:null,element:Xi,name:Yi})];var Ji=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Qi.forEach((e=>{customElements.define(e.name,e.element)}));const e=Qi.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});const es="core/linter-rules/check-charset",ts=Oe({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var ns=Object.freeze({__proto__:null,name:es,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||et(ts.msg,es,{hint:ts.hint,elements:[...t]})}});const rs="core/linter-rules/check-punctuation",os=[".",":","!","?"],is=Oe({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${os.map((e=>`"${e}"`)).join(", ")}.`}});var ss=Object.freeze({__proto__:null,name:rs,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${os.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&et(is.msg,rs,{hint:is.hint,elements:n})}});const as="core/linter-rules/local-refs-exist",ls=Oe({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function cs(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var us=Object.freeze({__proto__:null,name:as,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(cs);t.length&&et(ls.msg,as,{hint:ls.hint,elements:t})}});const ds="core/linter-rules/no-headingless-sections",ps=Oe({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"}});var hs=Object.freeze({__proto__:null,name:ds,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&et(ps.msg,ds,{hint:ps.hint,elements:t})}});const fs="core/linter-rules/no-unused-vars",ms=Oe({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var gs=Object.freeze({__proto__:null,name:fs,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=je(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&et(ms.msg,fs,{hint:ms.hint,elements:t})}});const bs="core/linter-rules/privsec-section",ys=Oe({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var ws=Object.freeze({__proto__:null,name:bs,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&et(ys.msg,bs,{hint:ys.hint})}});const vs="core/linter-rules/no-http-props",xs=Oe({en:{msg:rt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:rt`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var ks=Object.freeze({__proto__:null,name:vs,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=Pe(t,(e=>rt`${`[${e}]`}`));et(xs.msg,vs,{hint:xs.hint+e})}}}),$s=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),_s=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); //# sourceMappingURL=respec-dini.js.map diff --git a/builds/respec-dini.js.map b/builds/respec-dini.js.map index 828d19b8df..2a5a60405a 100644 --- a/builds/respec-dini.js.map +++ b/builds/respec-dini.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-dini.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/reindent.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/dini.js","../src/core/location-hash.js","../src/core/defaults.js","../src/dini/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/dini/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/dini/templates/headers.js","../src/dini/headers.js","../src/dini/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/dini/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v4.2.12 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction merge(obj) {\n let i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n}\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = merge({}, block);\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = merge({}, block.normal, {\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n});\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = merge({}, block.normal, {\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = merge({}, inline);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = merge({}, inline.normal, {\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = merge({}, inline.normal, {\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n});\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n});\n\n/**\n * smartypants text replacement\n * @param {string} text\n */\nfunction smartypants(text) {\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n}\n\n/**\n * mangle email addresses\n * @param {string} text\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${level}>\\n`;\n }\n\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `<li>${text}</li>\\n`;\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `<tbody>${body}</tbody>`;\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n function onError(e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n\n try {\n const tokens = Lexer.lex(src, opt);\n if (opt.walkTokens) {\n if (opt.async) {\n return Promise.all(marked.walkTokens(tokens, opt.walkTokens))\n .then(() => {\n return Parser.parse(tokens, opt);\n })\n .catch(onError);\n }\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parse(tokens, opt);\n } catch (e) {\n onError(e);\n }\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n merge(marked.defaults, opt);\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = merge({}, pack);\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = function(src, opt) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked.parseInline(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked.parseInline(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n try {\n const tokens = Lexer.lexInline(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parseInline(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n};\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: #193766;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: white;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/dini/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/dini/style.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/dini/headers.js\"),\n import(\"../src/dini/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/dini/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for DINI specs\n */\nexport const name = \"dini/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"cc-by-sa\",\n {\n name: \"Creative Commons Attribution-ShareAlike 4.0 International Public License\",\n short: \"CC-BY-SA\",\n url: \"https://creativecommons.org/licenses/by-sa/4.0/legalcode\",\n },\n ],\n]);\n\nconst diniDefaults = {\n format: \"markdown\",\n isED: false,\n isNoTrack: true,\n isPR: false,\n lint: {\n \"privsec-section\": true,\n \"wpt-tests-exist\": false,\n },\n logos: [],\n prependW3C: false,\n doJsonLd: false,\n license: \"cc-by\",\n shortName: \"X\",\n showPreviousVersion: false,\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...diniDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...diniDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module dini/style\n// Inserts a link to the appropriate W3C style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"dini/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"无标题\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} 이전 `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 以前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` 直到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () => html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n>\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n</svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData, showWarning } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst name = \"dini/templates/headers\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/legalcode\";\n\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n this_version: \"This version:\",\n },\n ko: {\n author: \"저자:\",\n authors: \"저자:\",\n editor: \"편집자:\",\n editors: \"편집자:\",\n former_editor: \"이전 편집자:\",\n former_editors: \"이전 편집자:\",\n latest_editors_draft: \"최신 편집 초안:\",\n latest_published_version: \"최신 버전:\",\n this_version: \"현재 버전:\",\n },\n zh: {\n author: \"作者:\",\n authors: \"作者:\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n this_version: \"本版本:\",\n },\n ja: {\n author: \"著者:\",\n authors: \"著者:\",\n editor: \"編者:\",\n editors: \"編者:\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n this_version: \"このバージョン:\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n author: \"Autor:\",\n authors: \"Autores:\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n latest_editors_draft: \"Borrador de editor mas reciente:\",\n latest_published_version: \"Versión publicada mas reciente:\",\n this_version: \"Ésta versión:\",\n },\n de: {\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n former_editor: \"Frühere Mitwirkende:\",\n former_editors: \"Frühere Mitwirkende:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n this_version: \"Diese Fassung:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${document.querySelector(\"h1#title\")}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${renderCopyright(conf)}\n <hr />\n </div>`;\n};\n\n/**\n * @param {string} text\n * @param {string} url\n * @param {string=} cssClass\n */\nfunction linkLicense(text, url, cssClass) {\n return html`<a rel=\"license\" href=\"${url}\" class=\"${cssClass}\">${text}</a>`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.hasOwnProperty(\"overrideCopyright\")) {\n const msg = \"The `overrideCopyright` configuration option is deprecated.\";\n const hint = 'Please use `<p class=\"copyright\">` instead.';\n showWarning(msg, name, { hint });\n }\n return conf.overrideCopyright\n ? [conf.overrideCopyright]\n : html`<p class=\"copyright\">\n Dieses Dokument ist lizensiert unter\n ${linkLicense(\n \"Creative Commons Attribution 4.0 International Public License\",\n ccLicense,\n \"subfoot\"\n )}.\n </p>`;\n}\n","// @ts-check\n// Module dini/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by-sa\"\n// - \"cc-by\"\n// - \"cc0\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"dini/headers\";\n\nconst DINIDate = new Intl.DateTimeFormat([\"de-DE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\nconst status2text = {\n unofficial: \"Entwurf vom\",\n base: \"Spezifikation vom\",\n};\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.isBasic = conf.specStatus === \"base\";\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"Kein Titel\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = DINIDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n if (it.orcid) {\n try {\n it.orcid = normalizeOrcid(it.orcid);\n } catch (e) {\n const msg = `\"${it.orcid}\" is not an ORCID. ${e.message}`;\n showError(msg, name);\n // A failed orcid link could link to something outside of orcid,\n // which would be misleading.\n delete it.orcid;\n }\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n (conf.alternateFormats || []).forEach(it => {\n if (!it.uri || !it.label) {\n const msg = \"All alternate formats must have a uri and a label.\";\n showError(msg, name);\n }\n });\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n\n/**\n * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the /\n * @return {string} the full ORCID URL. Throws an error if the ID is invalid.\n */\nfunction normalizeOrcid(orcid) {\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n if (orcidUrl.origin !== \"https://orcid.org\") {\n throw new Error(\n `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`\n );\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n throw new Error(\n `ORCIDs have the format \"1234-1234-1234-1234\", not \"${orcidId}\"`\n );\n }\n\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcidId[orcidId.length - 1];\n const remainder = orcidId\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n if (lastDigit !== lastDigitShould) {\n throw new Error(`\"${orcidId}\" has an invalid checksum.`);\n }\n\n return orcidUrl.href;\n}\n","// @ts-check\n// Module dini/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"dini/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n ko: {\n abstract: \"요약\",\n },\n zh: {\n abstract: \"摘要\",\n },\n ja: {\n abstract: \"要約\",\n },\n nl: {\n abstract: \"Samenvatting\",\n },\n es: {\n abstract: \"Resumen\",\n },\n de: {\n abstract: \"Zusammenfassung\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = `Document must have one element with \\`id=\"abstract\"`;\n showError(msg, name);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n.abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"참조\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY?\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module dini/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"dini/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die Schlüsselwörter\" : \"Das Schlüsselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemäß\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter Berücksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groß geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before {\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n return dfnsByType.get(linkType) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","merge","key","i","arguments","length","Object","hasOwnProperty","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","trim","pop","splice","push","invert","l","suffLen","currChar","slice","checkSanitizeDeprecation","console","warn","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","marked","err","pending","setTimeout","onError","message","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","Set","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","msg","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","markdown","reindent$1","headers","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","diniDefaults","isED","isNoTrack","isPR","logos","prependW3C","doJsonLd","license","shortName","showPreviousVersion","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","width","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","alt","height","until","date","es","ko","ja","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","ccLicense","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","nl","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","overrideCopyright","cssClass","renderCopyright","DINIDate","status2text","unofficial","isUnofficial","isBasic","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","publishYear","getUTCFullYear","peopCheck","normalizeOrcid","alternateFormats","uri","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","arg","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAAO,CAAEC,YACjDnB,OAAOsB,SAAWtB,OAAOuB,KAC3B,OAGF,MAAMC,EAAOC,OAAOC,KAAKC,UAAUR,GAAQS,OAAST,IACpDnB,OAAOs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C,sBAAuB,UACxB,CAAC,oBAAqB,SACtB,CAAC,SAAU,MACX,CAAC,WAAY,OACb,CAAC,OAAQ,QACT3E,SAAQ,SAAU2E,GAClB,OAAOR,EAAU0B,cAAclB,EAAK,GAAIA,EAAK,GAClD,IAKG,CACE,CAAC,MAAO,IACR,CAAC,SAAU,MACX,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACV3E,SAAQ,SAAU2E,GAClB,OAAOR,EAAU4B,gBAAgBpB,EAAK,GAAIA,EAAK,GACpD,IAKG,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACA3E,QAAQmE,EAAU6B,oB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GAAO8tB,GAVe,CAC1B5tB,GAAI,CACFuyB,IAAKS,EAAO,oCAAoC,oBAChDvG,KAAM,0DAERoX,GAAI,CACFtR,IAAKS,EAAO,GAAG,kCACfvG,KAAM,0EAKH,SAAayL,GAClB,IAAKA,EAAKmH,OAhBK,iBAiBb,OAKF,IAAK9gC,OAAOQ,SAASuK,KAAK4iB,WAAW,QACnC,OAGF,MAAMwkC,EAAmBjmD,OAAOkmD,oBAAoBz4B,GAEjDxnB,QAAOrG,GAAQA,EAAI6oB,SAAS,QAAUgF,EAAK7tB,IAAiB,WAARA,IAEpDqG,QAAOrG,GACN,IAAIgiB,IAAI6L,EAAK7tB,GAAM9L,OAAOQ,SAASuK,MAAMA,KAAK4iB,WAAW,aAG7D,GAAIwkC,EAAiBlmD,OAAQ,CAC3B,MAAMoM,EAAO8W,GAAQgjC,GAAkBrmD,GAAO2oB,EAAO,GAAG,IAAI3oB,SAC5DgkB,GAAYvuB,GAAKyyB,IAAKz0B,GAAM,CAAE2uB,KAAM3sB,GAAK2sB,KAAO7V,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file +{"version":3,"file":"respec-dini.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/reindent.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/dini.js","../src/core/location-hash.js","../src/core/defaults.js","../src/dini/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/dini/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/dini/templates/headers.js","../src/dini/headers.js","../src/dini/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/dini/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.normal,\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\n */\nfunction smartypants(text) {\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n}\n\n/**\n * mangle email addresses\n * @param {string} text\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${level}>\\n`;\n }\n\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `<li>${text}</li>\\n`;\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `<tbody>${body}</tbody>`;\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = parser(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...marked.defaults, ...opt };\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: #193766;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: white;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/dini/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/dini/style.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/dini/headers.js\"),\n import(\"../src/dini/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/dini/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for DINI specs\n */\nexport const name = \"dini/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"cc-by-sa\",\n {\n name: \"Creative Commons Attribution-ShareAlike 4.0 International Public License\",\n short: \"CC-BY-SA\",\n url: \"https://creativecommons.org/licenses/by-sa/4.0/legalcode\",\n },\n ],\n]);\n\nconst diniDefaults = {\n format: \"markdown\",\n isED: false,\n isNoTrack: true,\n isPR: false,\n lint: {\n \"privsec-section\": true,\n \"wpt-tests-exist\": false,\n },\n logos: [],\n prependW3C: false,\n doJsonLd: false,\n license: \"cc-by\",\n shortName: \"X\",\n showPreviousVersion: false,\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...diniDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...diniDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module dini/style\n// Inserts a link to the appropriate W3C style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"dini/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"无标题\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} 이전 `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 以前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` 直到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () => html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n>\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n</svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData, showWarning } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst name = \"dini/templates/headers\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/legalcode\";\n\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n this_version: \"This version:\",\n },\n ko: {\n author: \"저자:\",\n authors: \"저자:\",\n editor: \"편집자:\",\n editors: \"편집자:\",\n former_editor: \"이전 편집자:\",\n former_editors: \"이전 편집자:\",\n latest_editors_draft: \"최신 편집 초안:\",\n latest_published_version: \"최신 버전:\",\n this_version: \"현재 버전:\",\n },\n zh: {\n author: \"作者:\",\n authors: \"作者:\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n this_version: \"本版本:\",\n },\n ja: {\n author: \"著者:\",\n authors: \"著者:\",\n editor: \"編者:\",\n editors: \"編者:\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n this_version: \"このバージョン:\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n author: \"Autor:\",\n authors: \"Autores:\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n latest_editors_draft: \"Borrador de editor mas reciente:\",\n latest_published_version: \"Versión publicada mas reciente:\",\n this_version: \"Ésta versión:\",\n },\n de: {\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n former_editor: \"Frühere Mitwirkende:\",\n former_editors: \"Frühere Mitwirkende:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n this_version: \"Diese Fassung:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${document.querySelector(\"h1#title\")}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${renderCopyright(conf)}\n <hr />\n </div>`;\n};\n\n/**\n * @param {string} text\n * @param {string} url\n * @param {string=} cssClass\n */\nfunction linkLicense(text, url, cssClass) {\n return html`<a rel=\"license\" href=\"${url}\" class=\"${cssClass}\">${text}</a>`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.hasOwnProperty(\"overrideCopyright\")) {\n const msg = \"The `overrideCopyright` configuration option is deprecated.\";\n const hint = 'Please use `<p class=\"copyright\">` instead.';\n showWarning(msg, name, { hint });\n }\n return conf.overrideCopyright\n ? [conf.overrideCopyright]\n : html`<p class=\"copyright\">\n Dieses Dokument ist lizensiert unter\n ${linkLicense(\n \"Creative Commons Attribution 4.0 International Public License\",\n ccLicense,\n \"subfoot\"\n )}.\n </p>`;\n}\n","// @ts-check\n// Module dini/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by-sa\"\n// - \"cc-by\"\n// - \"cc0\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"dini/headers\";\n\nconst DINIDate = new Intl.DateTimeFormat([\"de-DE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\nconst status2text = {\n unofficial: \"Entwurf vom\",\n base: \"Spezifikation vom\",\n};\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.isBasic = conf.specStatus === \"base\";\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"Kein Titel\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = DINIDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n if (it.orcid) {\n try {\n it.orcid = normalizeOrcid(it.orcid);\n } catch (e) {\n const msg = `\"${it.orcid}\" is not an ORCID. ${e.message}`;\n showError(msg, name);\n // A failed orcid link could link to something outside of orcid,\n // which would be misleading.\n delete it.orcid;\n }\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n (conf.alternateFormats || []).forEach(it => {\n if (!it.uri || !it.label) {\n const msg = \"All alternate formats must have a uri and a label.\";\n showError(msg, name);\n }\n });\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n\n/**\n * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the /\n * @return {string} the full ORCID URL. Throws an error if the ID is invalid.\n */\nfunction normalizeOrcid(orcid) {\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n if (orcidUrl.origin !== \"https://orcid.org\") {\n throw new Error(\n `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`\n );\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n throw new Error(\n `ORCIDs have the format \"1234-1234-1234-1234\", not \"${orcidId}\"`\n );\n }\n\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcidId[orcidId.length - 1];\n const remainder = orcidId\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n if (lastDigit !== lastDigitShould) {\n throw new Error(`\"${orcidId}\" has an invalid checksum.`);\n }\n\n return orcidUrl.href;\n}\n","// @ts-check\n// Module dini/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"dini/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n ko: {\n abstract: \"요약\",\n },\n zh: {\n abstract: \"摘要\",\n },\n ja: {\n abstract: \"要約\",\n },\n nl: {\n abstract: \"Samenvatting\",\n },\n es: {\n abstract: \"Resumen\",\n },\n de: {\n abstract: \"Zusammenfassung\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = `Document must have one element with \\`id=\"abstract\"`;\n showError(msg, name);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n.abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"참조\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY?\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module dini/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"dini/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die Schlüsselwörter\" : \"Das Schlüsselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemäß\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter Berücksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groß geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before {\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n return dfnsByType.get(linkType) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","reindent$1","headers","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","diniDefaults","isED","isNoTrack","isPR","logos","prependW3C","doJsonLd","license","shortName","showPreviousVersion","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","width","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","alt","height","until","date","es","ko","ja","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","ccLicense","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","nl","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","overrideCopyright","cssClass","renderCopyright","DINIDate","status2text","unofficial","isUnofficial","isBasic","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","publishYear","getUTCFullYear","peopCheck","normalizeOrcid","alternateFormats","uri","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EA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,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACV3F,SAAQ,SAAU2F,GAClB,OAAOR,EAAU6B,gBAAgBrB,EAAK,GAAIA,EAAK,GACpD,IAKG,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACA3F,QAAQmF,EAAU8B,oBAEb9B,CACV,IAGA,IAAIA,GAAYJ,GCjgBsBqC,GAAU,SAASC,GAAgB,IAAIlO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,EAAE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,QAAUgF,EAAK/M,IAAiB,WAARA,IAEpD1b,QAAO0b,GACN,IAAIoB,IAAI2L,EAAK/M,GAAMttB,OAAOQ,SAASwK,MAAMA,KAAKujB,WAAW,aAG7D,GAAIokC,EAAiBjmD,OAAQ,CAC3B,MAAMsL,EAAO+X,GAAQ4iC,GAAkBrlC,GAAO6H,EAAO,GAAG,IAAI7H,SAC5DoD,GAAYnvB,GAAKyZ,IAAKzb,GAAM,CAAEuvB,KAAMvtB,GAAKutB,KAAO9W,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file diff --git a/builds/respec-geonovum.js b/builds/respec-geonovum.js index 92172cebd6..df6bf6c49b 100644 --- a/builds/respec-geonovum.js +++ b/builds/respec-geonovum.js @@ -1,7 +1,7 @@ -window.respecVersion="32.8.0",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function i(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:i});const o=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function w(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function y(e){return"function"==typeof e?w(e):(e instanceof IDBTransaction&&function(e){if(f.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(v(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",o)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=y(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function S(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!k.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),i&&o.done]))[0]};return _.set(t,o),o}b=(e=>({...e,get:(t,n,r)=>S(t,n)||e.get(t,n,r),has:(t,n)=>!!S(t,n)||e.has(t,n)}))(b);var E=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{o&&e.addEventListener("close",(()=>o())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,L=/[\u000A\u000D\u0009\u0020]/u,A=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&A.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const j=/[&<>"']/,z=new RegExp(j.source,"g"),I=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,P=new RegExp(I.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},D=e=>O[e];function q(e,t){if(t){if(j.test(e))return e.replace(z,D)}else if(I.test(e))return e.replace(P,D);return e}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function B(e){return e.replace(M,((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 F=/(^|[^\[])\^/g;function W(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(F,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const U=/[^\w:]/g,H=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function G(e,t,n){if(e){let e;try{e=decodeURIComponent(B(n)).replace(U,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!H.test(n)&&(n=function(e,t){V[" "+e]||(Z.test(e)?V[" "+e]=e+"/":V[" "+e]=ee(e,"/",!0));const n=-1===(e=V[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(K,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Q,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const V={},Z=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,Q=/^([^:]+:\/*[^/]*)[\s\S]*$/;const J={exec:function(){}};function X(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Y(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),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 ee(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.slice(0,r-i)}function te(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ne(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function re(e,t,n,r){const i=t.href,o=t.title?q(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:q(s)}}class ie{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ee(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ee(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,i,o,s,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(o=2,p=c.trimLeft()):(o=t[2].search(/[^ ]/),o=o>4?1:o,p=c.slice(o),o+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!i.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=o||!u.trim())p+="\n"+u.slice(o);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(i.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(o)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(i="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:i,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const w=g.items.length;for(s=0;s<w;s++)if(this.lexer.state.top=!1,g.items[s].tokens=this.lexer.blockTokens(g.items[s].text,[]),!g.loose){const e=g.items[s].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s<w;s++)g.items[s].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Y(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,i,o,s=e.align.length;for(n=0;n<s;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(s=e.rows.length,n=0;n<s;n++)e.rows[n]=Y(e.rows[n],e.header.length).map((e=>({text:e})));for(s=e.header.length,r=0;r<s;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(s=e.rows.length,r=0;r<s;r++)for(o=e.rows[r],i=0;i<o.length;i++)o[i].tokens=this.lexer.inline(o[i].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:q(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ee(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),re(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return re(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||i&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let i,o,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=i.length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const t=e.slice(0,n+r.index+(r[0].length-i.length)+o);if(Math.min(n,o)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=q(e,!0),{type:"codespan",raw:t[0],text:e}}}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[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=q(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=q(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=q(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=q(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):q(n[0]):n[0]:q(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const oe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\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 *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:J,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};oe.def=W(oe.def).replace("label",oe._label).replace("title",oe._title).getRegex(),oe.bullet=/(?:[*+-]|\d{1,9}[.)])/,oe.listItemStart=W(/^( *)(bull) */).replace("bull",oe.bullet).getRegex(),oe.list=W(oe.list).replace(/bull/g,oe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oe.def.source+")").getRegex(),oe._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",oe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,oe.html=W(oe.html,"i").replace("comment",oe._comment).replace("tag",oe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe.paragraph=W(oe._paragraph).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oe._tag).getRegex(),oe.blockquote=W(oe.blockquote).replace("paragraph",oe.paragraph).getRegex(),oe.normal=X({},oe),oe.gfm=X({},oe.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),oe.gfm.table=W(oe.gfm.table).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oe._tag).getRegex(),oe.gfm.paragraph=W(oe._paragraph).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",oe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oe._tag).getRegex(),oe.pedantic=X({},oe.normal,{html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",oe._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+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:J,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(oe.normal._paragraph).replace("hr",oe.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",oe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:J,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)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:J,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function ae(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function le(e){let t,n,r="";const i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",se.punctuation=W(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,se.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,se._comment=W(oe._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),se.emStrong.lDelim=W(se.emStrong.lDelim).replace(/punct/g,se._punctuation).getRegex(),se.emStrong.rDelimAst=W(se.emStrong.rDelimAst,"g").replace(/punct/g,se._punctuation).getRegex(),se.emStrong.rDelimUnd=W(se.emStrong.rDelimUnd,"g").replace(/punct/g,se._punctuation).getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=W(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=W(se.tag).replace("comment",se._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=W(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=W(se.reflink).replace("label",se._label).replace("ref",oe._label).getRegex(),se.nolink=W(se.nolink).replace("ref",oe._label).getRegex(),se.reflinkSearch=W(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=X({},se),se.pedantic=X({},se.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:W(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=X({},se.normal,{escape:W(se.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),se.gfm.url=W(se.gfm.url,"i").replace("email",se.gfm._extended_email).getRegex(),se.breaks=X({},se.gfm,{br:W(se.br).replace("{2,}","*").getRegex(),text:W(se.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class ce{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ie,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:oe.normal,inline:se.normal};this.options.pedantic?(t.block=oe.pedantic,t.inline=se.pedantic):this.options.gfm&&(t.block=oe.gfm,this.options.breaks?t.inline=se.breaks:t.inline=se.gfm),this.tokenizer.rules=t}static get rules(){return{block:oe,inline:se}}static lex(e,t){return new ce(t).lex(e)}static lexInline(e,t){return new ce(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,o,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+ne("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+ne("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,o.index+o[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,le))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,le))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,ae))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}let ue=class{constructor(e){this.options=e||N}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+q(r)+'">'+(n?e:q(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:q(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class de{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,n){return""+n}image(e,t,n){return""+n}br(){return""}}class pe{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class fe{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new de,this.slugger=new pe}static parse(e,t){return new fe(t).parse(e)}static parseInline(e,t){return new fe(t).parseInline(e)}parse(e,t=!0){let n,r,i,o,s,a,l,c,u,d,p,f,h,m,g,b,w,y,v,x="";const k=e.length;for(n=0;n<k;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))x+=v||"";else switch(d.type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,B(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",o=d.header.length,r=0;r<o;r++)l+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(l),u="",o=d.rows.length,r=0;r<o;r++){for(a=d.rows[r],l="",s=a.length,i=0;i<s;i++)l+=this.renderer.tablecell(this.parseInline(a[i].tokens),{header:!1,align:d.align[i]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,o=d.items.length,u="",r=0;r<o;r++)g=d.items[r],b=g.checked,w=g.task,m="",g.task&&(y=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=y+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,w,b);x+=this.renderer.list(u,p,f);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);x+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return x}parseInline(e,t){t=t||this.renderer;let n,r,i,o="";const s=e.length;for(n=0;n<s;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(i=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==i||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))o+=i||"";else switch(r.type){case"escape":case"text":o+=t.text(r.text);break;case"html":o+=t.html(r.text);break;case"link":o+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":o+=t.image(r.href,r.title,r.text);break;case"strong":o+=t.strong(this.parseInline(r.tokens,t));break;case"em":o+=t.em(this.parseInline(r.tokens,t));break;case"codespan":o+=t.codespan(r.text);break;case"br":o+=t.br();break;case"del":o+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return o}}function he(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("function"==typeof t&&(n=t,t=null),te(t=X({},he.defaults,t||{})),n){const r=t.highlight;let i;try{i=ce.lex(e,t)}catch(e){return n(e)}const o=function(e){let o;if(!e)try{t.walkTokens&&he.walkTokens(i,t.walkTokens),o=fe.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,o)};if(!r||r.length<3)return o();if(delete t.highlight,!i.length)return o();let s=0;return he.walkTokens(i,(function(e){"code"===e.type&&(s++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return o(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),s--,0===s&&o()}))}),0))})),void(0===s&&o())}function r(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+q(e.message+"",!0)+"</pre>";throw e}try{const n=ce.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(he.walkTokens(n,t.walkTokens)).then((()=>fe.parse(n,t))).catch(r);he.walkTokens(n,t.walkTokens)}return fe.parse(n,t)}catch(e){r(e)}}he.options=he.setOptions=function(e){var t;return X(he.defaults,e),t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n=X({},e);if(n.async=he.defaults.async||n.async,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new ue;for(const n in e.renderer){const r=t[n];t[n]=(...i)=>{let o=e.renderer[n].apply(t,i);return!1===o&&(o=r.apply(t,i)),o}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new ie;for(const n in e.tokenizer){const r=t[n];t[n]=(...i)=>{let o=e.tokenizer[n].apply(t,i);return!1===o&&(o=r.apply(t,i)),o}}n.tokenizer=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");te(t=X({},he.defaults,t||{}));try{const n=ce.lexInline(e,t);return t.walkTokens&&he.walkTokens(n,t.walkTokens),fe.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+q(e.message+"",!0)+"</pre>";throw e}},he.Parser=fe,he.parser=fe.parse,he.Renderer=ue,he.TextRenderer=de,he.Lexer=ce,he.lexer=ce.lex,he.Tokenizer=ie,he.Slugger=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline,fe.parse,ce.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.exports=t()}(0,(function(){var e=[],t=[],n={},r={},i={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function s(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var i=a(t[1],arguments);return s(""===n?e[r-1]:n,i)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var i=r.length;i--;){var o=r[i];if(o[0].test(t))return l(t,o)}return t}function u(e,t,n){return function(r){var i=r.toLowerCase();return t.hasOwnProperty(i)?s(r,i):e.hasOwnProperty(i)?s(r,e[i]):c(i,r,n)}}function d(e,t,n,r){return function(r){var i=r.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&c(i,i,n)===i}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(i,r,e),p.isPlural=d(i,r,e),p.singular=u(r,i,t),p.isSingular=d(r,i,t),p.addPluralRule=function(t,n){e.push([o(t),n])},p.addSingularRule=function(e,n){t.push([o(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var be=ge,we=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,i=o.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},o;function o(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(s,this)}function s(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=i.prototype;function i(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=i}(Math.random(),Object.defineProperty)}function i(e,t,n,r,i,o){for(var s=("selectedIndex"in t),a=s;r<i;){var l,c=e(n[r],1);t.insertBefore(c,o),s&&a&&c.selected&&(a=!a,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function o(e,t){return e==t}function s(e){return e}function a(e,t,n,r,i,o,s){var a=o-i;if(a<1)return-1;for(;a<=n-t;){for(var l=t,c=i;l<n&&c<o&&s(e[l],r[c]);)l++,c++;if(c===o)return t;t=l+1}return-1}function l(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function c(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,i=t;r<i;){var o=(r+i)/2>>>0;n<e[o]?i=o:r=1+o}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||o,d=r.node||s,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,w=0;g<m&&w<b&&u(t[g],n[w]);)g++,w++;for(;g<m&&w<b&&u(t[m-1],n[b-1]);)m--,b--;var y=g===m,v=w===b;if(y&&v)return n;if(y&&w<b)return i(d,e,n,w,b,l(d,t,g,h,f)),n;if(v&&g<m)return c(d,t,g,m),n;var x=m-g,k=b-w,$=-1;if(x<k){if(-1<($=a(n,w,b,t,g,m,u)))return i(d,e,n,w,$,d(t[g],0)),i(d,e,n,$+x,b,l(d,t,m,h,f)),n}else if(k<x&&-1<($=a(t,g,m,n,w,b,u)))return c(d,t,g,$),c(d,t,$+k,m),n;return x<2||k<2?(i(d,e,n,w,b,d(t[g],0)),c(d,t,g,m)):x==k&&function(e,t,n,r,i,o){for(;r<i&&o(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?i(d,e,n,w,b,l(d,t,m,h,f)):function(e,t,n,r,o,s,a,l,u,d,f,h,m){!function(e,t,n,r,o,s,a,l,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:o++,f++;break;case 1:d.push(r[o]),i(t,n,r,o++,o,f<l?t(s[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(s[a])?a++:c(t,s,a++,a)}}(function(e,t,n,r,i,o,s){var a,l,c,u,d,p,f=n+o,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(l=(c=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;c<o&&l<n&&s(r[i+c],e[t+l]);)c++,l++;if(c===o&&l===n)break e;d[b+a]=c}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<c&&0<l&&s(r[i+c-1],e[t+l-1]);)m[g--]=0,c--,l--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=c-l)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,s,a,l,d,h)||function(e,t,n,r,i,o,s,a){var l=0,c=r<a?r:a,u=Array(c++),d=Array(c);d[0]=-1;for(var f=1;f<c;f++)d[f]=s;for(var h=i.slice(o,s),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(l=p(d,c,g=b+o))&&(d[l]=g,u[l]={newi:m,oldi:g,prev:u[l-1]})}for(l=--c,--s;d[l]>s;)--l;c=a+r-l;var w=Array(c),y=u[l];for(--n;y;){for(var v=y.newi,x=y.oldi;v<n;)w[--c]=1,--n;for(;x<s;)w[--c]=-1,--s;w[--c]=0,--n,--s,y=y.prev}for(;t<=n;)w[--c]=1,--n;for(;o<=s;)w[--c]=-1,--s;return w}(n,r,o,s,a,l,u,d),e,t,n,r,a,l,f,m)}(d,e,n,w,b,k,t,g,m,x,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,w={};try{w.Map=Map}catch(u){w.Map=function(){var e=0,t=[],n=[];return{delete:function(i){var o=r(i);return o&&(t.splice(e,1),n.splice(e,1)),o},forEach:function(e,r){t.forEach((function(t,i){e.call(r,n[i],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(i,o){return n[r(i)?e:t.push(i)-1]=o,this}};function r(n){return-1<(e=t.indexOf(n))}}}var y=w.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,S,E,C,L,A={},T={},R=[],N=T.hasOwnProperty,j=0,z={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(j=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<j;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},I=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),P=(S=e,E="fragment",L="content"in D(C="template")?function(e){var t=D(C);return t.innerHTML=e,t.content}:function(e){var t,n=D(E),r=D(C);return O(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=D(E),n=D("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",O(t,n.firstChild.childNodes),t}:L)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function D(e){return e===E?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,B,F,W,U,H,G,V,Z=(M="appendChild",B="cloneNode",F="createTextNode",U=(W="importNode")in(q=e),(H=q.createDocumentFragment())[M](q[F]("g")),H[M](q[F]("")),(U?q[W](H,!0):H[B](!0)).childNodes.length<2?function e(t,n){for(var r=t[B](),i=t.childNodes||[],o=i.length,s=0;n&&s<o;s++)r[M](e(i[s],n));return r}:U?q[W]:function(e,t){return e[B](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Q="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Q+'"></p>',G.content.childNodes[0].getAttribute(V)==Q)||(Q="_dt: "+Q.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Q+"--\x3e",Y=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,ie="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",oe="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",se=new RegExp(ie+re+oe+"+)(["+te+"]*/?>)","g"),ae=new RegExp(ie+re+oe+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+Q+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,i){for(var o=t.childNodes,s=o.length,a=0;a<s;){var l=o[a];switch(l.nodeType){case 1:var c=i.concat(a);!function(t,n,r,i){for(var o,s=t.attributes,a=[],l=[],c=pe(s,r),u=c.length,d=0;d<u;){var p=c[d++],f=p.value===Q;if(f||1<(o=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=s[m]||s[m.toLowerCase()];if(f)n.push(he(g,i,m,null));else{for(var b=o.length-2;b--;)r.shift();n.push(he(g,i,m,o))}}l.push(p)}}for(var w=((d=0)<(u=l.length)&&J&&!("ownerSVGElement"in t));d<u;){var y=l[d++];w&&(y.value=""),t.removeAttribute(y.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=s.length,d=0;d<u;)x.setAttributeNode(s[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(l,n,r,c),fe(l,n,r,c);break;case 8:var u=l.textContent;if(u===Q)r.shift(),n.push(Y.test(t.nodeName)?me(t,i):{type:"any",node:l,path:i.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),a--,s--}break;case 3:Y.test(t.nodeName)&&K.call(l.textContent)===X&&(r.shift(),n.push(me(t,i)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function we(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(se,ce)})(t),r=e.transform;r&&(n=r(n));var i=P(n,e.type);ve(i);var o=[];return fe(i,o,t.slice(0),[]),{content:i,updates:function(n){for(var r=[],i=o.length,s=0,a=0;s<i;){var l=o[s++],c=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,l.path);switch(l.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=l.sparse,d=e.attribute(c,l.name,l.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return i+=a,function(){var e=arguments.length;if(i!==e-1)throw new Error(e-1+" values instead of "+i+"\n"+t.join("${value}"));for(var o=1,s=1;o<e;){var a=r[o-s];if(a.sparse){var l=a.values,c=l[0],u=1,d=l.length;for(s+=d-2;u<d;)c+=arguments[o++]+l[u++];a.fn(c)}else a.fn(arguments[o++])}return n}}}}var ye=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var xe,ke,$e=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(i){var o,s,a,l;switch(typeof i){case"object":if(i){if("object"===n){if(!t&&r!==i)for(s in r)s in i||(e[s]="")}else t?e.value="":e.cssText="";for(s in o=t?{}:e,i)a="number"!=typeof(l=i[s])||xe.test(s)?l:l+"px",!t&&/^--/.test(s)?o.setProperty(s,a):o[s]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=o):r=i;break}default:r!=i&&(n="string",r=i,t?e.value=i||"":e.cssText=i||"")}}}var Ee,Ce,Le=(Ee=[].slice,(Ce=Ae.prototype).ELEMENT_NODE=1,Ce.nodeType=111,Ce.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Ce.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,o=r.length;i<o;i++)t.appendChild(r[i]);return t},Ae);function Ae(e){var t=this.childNodes=Ee.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Me:return Re(e.render(),t);default:return e}}function Ne(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Te).then(t):Promise.resolve(z.invoke(e,t)).then(t)}function je(e){return null!=e&&"then"in e}var ze,Ie,Pe,Oe,De,qe="ownerSVGElement",Me=v.prototype.nodeType,Be=Le.prototype.nodeType,Fe=(Ie=(ze={Event:b,WeakSet:u}).Event,Pe=ze.WeakSet,Oe=!0,De=null,function(e){return Oe&&(Oe=!Oe,De=new Pe,function(e){var t=new Pe,n=new Pe;try{new MutationObserver(s).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,i=[],o=function(e){i.push(e),clearTimeout(r),r=setTimeout((function(){s(i.splice(r=0,i.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){o({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){o({addedNodes:[e.target],removedNodes:[]})}),!0)}function s(e){for(var r,i=e.length,o=0;o<i;o++)a((r=e[o]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var i,o=new Ie(t),s=e.length,a=0;a<s;1===(i=e[a++]).nodeType&&function e(t,n,r,i,o){De.has(t)&&!i.has(t)&&(o.delete(t),i.add(t),t.dispatchEvent(n));for(var s=t.children||[],a=s.length,l=0;l<a;e(s[l++],n,r,i,o));}(i,o,t,n,r));}}(e.ownerDocument)),De.add(e),e}),We=/^(?:form|list)$/i,Ue=[].slice;function He(t){return this.type=t,function(t){var n=ye,r=ve;return function(i){var o,s,a;return n!==i&&(o=t,s=n=i,a=be.get(s)||be.set(s,we(o,s)),r=a.updates(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,i=qe in e;if("style"===t)return $e(e,n,i);if("."===t.slice(0,1))return c=e,u=t.slice(1),i?function(e){try{c[u]=e}catch(t){c.setAttribute(u,e)}}:function(e){c[u]=e};if("?"===t.slice(0,1))return s=e,a=t.slice(1),function(e){l!==!!e&&((l=!!e)?s.setAttribute(a,""):s.removeAttribute(a))};if(/^on/.test(t)){var o=t.slice(2);return"connected"===o||"disconnected"===o?Fe(e):t.toLowerCase()in e&&(o=o.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(o,r,!1),(r=t)&&e.addEventListener(o,t,!1))}}if("data"===t||!i&&t in e&&!We.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in z.attributes)return function(n){var i=z.attributes[t](e,n);r!==i&&(null==(r=i)?e.removeAttribute(t):e.setAttribute(t,i))};var s,a,l,c,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Re,before:e},i=qe in e?"svg":"html",o=!1;return function s(a){switch(typeof a){case"string":case"number":case"boolean":o?n!==a&&(n=a,t[0].textContent=a):(o=!0,n=a,t=h(e.parentNode,t,[(l=a,e.ownerDocument.createTextNode(l))],r));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){o=!1,t=h(e.parentNode,t,[],r);break}default:if(o=!1,I(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":s({html:a});break;case"object":if(I(a[0])&&(a=a.concat.apply([],a)),je(a[0])){Promise.all(a).then(s);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ue.call(a.childNodes):[a],r):je(a)?a.then(s):"placeholder"in a?Ne(a,s):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=h(e.parentNode,t,Ue.call(P([].concat(a.html).join(""),i).childNodes),r):s("length"in a?Ue.call(a):z.invoke(a,s))}var l}},text:function(e){var t;return function n(r){var i;t!==r&&("object"==(i=typeof(t=r))&&r?je(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ue.call(r).join(""):z.invoke(r,n)):"function"==i?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,i,o,s,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),l=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||l?(i={},o=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)},Ve=l?o:(s=new n,function(e){return s.get(e)||(n=o(t=e),s.set(t,n),n);var t,n})):Ge=!0,Ze(t)};function Ze(e){return Ge?e:Ve(e)}function Ke(e){for(var t=arguments.length,n=[Ze(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Qe=new n,Je=function(e){var t,n,r;return function(){var i=Ke.apply(null,arguments);return r!==i[0]?(r=i[0],n=new He(e),t=Ye(n.apply(n,i))):n.apply(n,i),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Qe.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Qe.set(e,r={}),r[i]||(r[i]=Je(t))},Ye=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Le(t):e},et=new n;function tt(){var e=et.get(this),t=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(qe in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,it,ot,st=z.define,at=He.prototype;function lt(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?lt.bind(e):Xe(e,"html"):("raw"in e?Je("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=st,lt.diff=h,(lt.hyper=lt).observe=Fe,lt.tagger=at,lt.wire=function(e,t){return null==e?Je(t||"html"):Xe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,it=Object.create,ot=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,i){var o,s,a,l=t.get(e)||ot(e,t);switch(typeof i){case"object":case"function":var c=l.w||(l.w=new n);return c.get(i)||(o=c,s=i,a=new e(r),o.set(s,a),a);default:var u=l.p||(l.p=it(null));return u[i]||(u[i]=new e(r))}}(this,rt.get(e)||(r=e,i=new y,rt.set(r,i),i),e,null==t?"default":t);var r,i}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",nt),svg:x("svg",nt),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),lt}(document); -/*! (c) Andrea Giammarchi (ISC) */const ye=we,ve=E,xe=he,ke=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",i=null,o=new Map,s="type",a=Array.from(e);for(let e=0;e<a.length;e++){const l=a[e];switch(s){case"type":if("/"===l){s="subtype";continue}t+=l;break;case"subtype":if(";"===l){s="param-start";continue}n+=l;break;case"param-start":if(L.test(l)||";"===l)continue;r+=l,s="param-name";break;case"param-name":if("="===l||";"===l){if("="===l){s="param-value",i=null;continue}o.set(r.toLowerCase(),null),r="";continue}r+=l;break;case"param-value":if('"'==l){s="collect-quoted-string";continue}if(";"===l){i=i.trimEnd(),s="param-start",T(o,r,i),r="";continue}i="string"==typeof i?i+l:l;break;case"collect-quoted-string":if('"'===l){T(o,r,i),s="ignore-input-until-next-param",r="",i=null;continue}if("\\"===l)continue;i="string"==typeof i?i+l:l;break;case"ignore-input-until-next-param":if(";"!==l)continue;s="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${s} `)}}r&&T(o,r,i);if(""===t.trim()||!C.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!C.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(o.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?C.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},$e=be;function _e(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Se=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Ee=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"});"en"===l||l.startsWith("en-");function Le(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Ae(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Te(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:i})=>"element"===n&&t?t(i,r++,e):i))}}const Re=Te("conjunction"),Ne=Te("disjunction");function je(e,t){return Re(e,t).join("")}function ze(e){return e.trim().replace(/\s+/g," ")}function Ie(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Pe(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Xe(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function Oe(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>ye`${e}, `));return ye`${r}${n[n.length-1]}`}function De(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let i=r?n:n.toLowerCase();if(i=i.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),i?!/\.$/.test(i)&&/^[a-z]/i.test(t||i)||(i=`x${i}`):i="generatedID",t&&(i=`${t}-${i}`),e.ownerDocument.getElementById(i)){let t=0,n=`${i}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${i}-${t}`;i=n}return e.id=i,i}function qe(e){const t=new Set,n="ltNodefault"in e.dataset?"":ze(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>ze(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(ze(e))))}return[...t]}function Me(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function Be(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function Fe(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function We(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Ue(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class He extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Ge(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Me(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ve(t),t}function Ve(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ze(t)])e.remove()}function*Ze(e){for(;e.nextNode();)yield e.currentNode}class Ke extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Qe extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||De(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:i,elements:o,title:s,details:a}=this;return{message:e,name:t,plugin:r,hint:i,elements:o,title:s,details:a,stack:n}}}function Je(e,t,n={}){const i={...n,isWarning:!1};r("error",new Qe(e,t,i))}function Xe(e,t,n={}){const i={...n,isWarning:!0};r("warn",new Qe(e,t,i))}function Ye(e){return e?`\`${e}\``:""}function et(e,{quotes:t}={quotes:!1}){return Ne(e,t?e=>Ye(tt(e)):Ye).join("")}function tt(e){return String(e)?`"${e}"`:""}function nt(e,...t){return _e(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[i,o]=r.slice(1,-1).split("|");if(o){return`${e}[${i}](${new URL(o,"https://respec.org/docs/")})`}return`${e}[\`${i}\`](https://respec.org/docs/#${i})`})).join(""))}const rt=new Map([["text/html","html"],["application/xml","xml"]]);function it(e,t=document){const n=rt.get(e);if(!n){const t=[...rt.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=ot(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function ot(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:i}=e;Ve(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Ae(i);const o=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&o.appendChild(s);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=ye`<meta charset="utf-8" />`);o.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=ye` +window.respecVersion="32.8.1",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const s=["githubToken","githubUser"];const i=document.documentElement;i&&!i.hasAttribute("lang")&&(i.lang="en",i.hasAttribute("dir")||(i.dir="ltr"));const a={},l=i.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function w(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function y(e){return"function"==typeof e?w(e):(e instanceof IDBTransaction&&function(e){if(f.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(v(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=y(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function S(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return _.set(t,s),s}b=(e=>({...e,get:(t,n,r)=>S(t,n)||e.get(t,n,r),has:(t,n)=>!!S(t,n)||e.has(t,n)}))(b);var E=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=v(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(v(i.result),e.oldVersion,e.newVersion,v(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,L=/[\u000A\u000D\u0009\u0020]/u,A=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&A.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const z=/[&<>"']/,j=new RegExp(z.source,"g"),P=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,I=new RegExp(P.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},D=e=>O[e];function q(e,t){if(t){if(z.test(e))return e.replace(j,D)}else if(P.test(e))return e.replace(I,D);return e}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function B(e){return e.replace(M,((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 F=/(^|[^\[])\^/g;function W(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(F,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const U=/[^\w:]/g,H=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function G(e,t,n){if(e){let e;try{e=decodeURIComponent(B(n)).replace(U,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!H.test(n)&&(n=function(e,t){V[" "+e]||(Z.test(e)?V[" "+e]=e+"/":V[" "+e]=Y(e,"/",!0));const n=-1===(e=V[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(K,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Q,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const V={},Z=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,Q=/^([^:]+:\/*[^/]*)[\s\S]*$/;const J={exec:function(){}};function X(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),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 Y(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const s=e.charAt(r-o-1);if(s!==t||n){if(s===t||!n)break;o++}else o++}return e.slice(0,r-o)}function ee(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,s=t.title?q(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:s,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:s,text:q(i)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Y(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Y(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,s,i,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(s=2,p=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,p=c.slice(s),s+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!i.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=s||!u.trim())p+="\n"+u.slice(s);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(i.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(s)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const w=g.items.length;for(i=0;i<w;i++)if(this.lexer.state.top=!1,g.items[i].tokens=this.lexer.blockTokens(g.items[i].text,[]),!g.loose){const e=g.items[i].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(i=0;i<w;i++)g.items[i].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:X(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,s,i=e.align.length;for(n=0;n<i;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(i=e.rows.length,n=0;n<i;n++)e.rows[n]=X(e.rows[n],e.header.length).map((e=>({text:e})));for(i=e.header.length,r=0;r<i;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(i=e.rows.length,r=0;r<i;r++)for(s=e.rows[r],o=0;o<s.length;o++)s[o].tokens=this.lexer.inline(s[o].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:q(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Y(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,s,i=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(s=o.length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+s);if(Math.min(n,s)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=q(e,!0),{type:"codespan",raw:t[0],text:e}}}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[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=q(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=q(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=q(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=q(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):q(n[0]):n[0]:q(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const re={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\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 *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:J,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=W(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=W(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=W(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,re.html=W(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=W(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=W(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=W(re.gfm.table).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.paragraph=W(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic={...re.normal,html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",re._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+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:J,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(re.normal._paragraph).replace("hr",re.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:J,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)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:J,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function se(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function ie(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=W(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=W(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=W(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=W(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=W(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=W(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=W(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=W(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=W(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=W(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=W(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...oe.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:W(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:W(oe.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oe.gfm.url=W(oe.gfm.url,"i").replace("email",oe.gfm._extended_email).getRegex(),oe.breaks={...oe.gfm,br:W(oe.br).replace("{2,}","*").getRegex(),text:W(oe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class ae{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:re.normal,inline:oe.normal};this.options.pedantic?(t.block=re.pedantic,t.inline=oe.pedantic):this.options.gfm&&(t.block=re.gfm,this.options.breaks?t.inline=oe.breaks:t.inline=oe.gfm),this.tokenizer.rules=t}static get rules(){return{block:re,inline:oe}}static lex(e,t){return new ae(t).lex(e)}static lexInline(e,t){return new ae(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+ee("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,s.index)+"["+ee("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,s.index+s[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,ie))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,ie))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,se))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+q(r)+'">'+(n?e:q(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:q(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class ce{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,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ue{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}parse(e,t=!0){let n,r,o,s,i,a,l,c,u,d,p,f,h,m,g,b,w,y,v,x="";const k=e.length;for(n=0;n<k;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))x+=v||"";else switch(d.type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,B(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",s=d.header.length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(l),u="",s=d.rows.length,r=0;r<s;r++){for(a=d.rows[r],l="",i=a.length,o=0;o<i;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:d.align[o]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,s=d.items.length,u="",r=0;r<s;r++)g=d.items[r],b=g.checked,w=g.task,m="",g.task&&(y=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=y+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,w,b);x+=this.renderer.list(u,p,f);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);x+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return x}parseInline(e,t){t=t||this.renderer;let n,r,o,s="";const i=e.length;for(n=0;n<i;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))s+=o||"";else switch(r.type){case"escape":case"text":s+=t.text(r.text);break;case"html":s+=t.html(r.text);break;case"link":s+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":s+=t.image(r.href,r.title,r.text);break;case"strong":s+=t.strong(this.parseInline(r.tokens,t));break;case"em":s+=t.em(this.parseInline(r.tokens,t));break;case"codespan":s+=t.codespan(r.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return s}}class pe{constructor(e){this.options=e||N}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function fe(e,t){return(n,r,o)=>{"function"==typeof r&&(o=r,r=null);const s={...r},i=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+q(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...he.defaults,...s}).silent,r.async,o);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const s=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return i(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&he.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=s,e?i(e):o(null,n)};if(!s||s.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return he.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{s(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(he.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(i);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&he.walkTokens(o,r.walkTokens);let s=t(o,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(e){return i(e)}}}function he(e,t,n){return fe(ae.lex,de.parse)(e,t,n)}he.options=he.setOptions=function(e){var t;return he.defaults={...he.defaults,...e},t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=he.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let s=e.renderer[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let s=e.tokenizer[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.tokenizer=t}if(e.hooks){const t=he.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(he.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const s=e.hooks[n].call(t,o);return r.call(t,s)}:t[n]=(...o)=>{let s=e.hooks[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.hooks=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=fe(ae.lexInline,de.parseInline),he.Parser=de,he.parser=de.parse,he.Renderer=le,he.TextRenderer=ce,he.Lexer=ae,he.lexer=ae.lex,he.Tokenizer=ne,he.Slugger=ue,he.Hooks=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function l(e,t){return e.replace(t[0],(function(n,r){var o=a(t[1],arguments);return i(""===n?e[r-1]:n,o)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return l(t,s)}return t}function u(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(o,r,e),p.isPlural=d(o,r,e),p.singular=u(r,o,t),p.isSingular=d(r,o,t),p.addPluralRule=function(t,n){e.push([s(t),n])},p.addSingularRule=function(e,n){t.push([s(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var be=ge,we=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r<o;){var l,c=e(n[r],1);t.insertBefore(c,s),i&&a&&c.selected&&(a=!a,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function s(e,t){return e==t}function i(e){return e}function a(e,t,n,r,o,s,i){var a=s-o;if(a<1)return-1;for(;a<=n-t;){for(var l=t,c=o;l<n&&c<s&&i(e[l],r[c]);)l++,c++;if(c===s)return t;t=l+1}return-1}function l(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function c(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var s=(r+o)/2>>>0;n<e[s]?o=s:r=1+s}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||s,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,w=0;g<m&&w<b&&u(t[g],n[w]);)g++,w++;for(;g<m&&w<b&&u(t[m-1],n[b-1]);)m--,b--;var y=g===m,v=w===b;if(y&&v)return n;if(y&&w<b)return o(d,e,n,w,b,l(d,t,g,h,f)),n;if(v&&g<m)return c(d,t,g,m),n;var x=m-g,k=b-w,$=-1;if(x<k){if(-1<($=a(n,w,b,t,g,m,u)))return o(d,e,n,w,$,d(t[g],0)),o(d,e,n,$+x,b,l(d,t,m,h,f)),n}else if(k<x&&-1<($=a(t,g,m,n,w,b,u)))return c(d,t,g,$),c(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,w,b,d(t[g],0)),c(d,t,g,m)):x==k&&function(e,t,n,r,o,s){for(;r<o&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,w,b,l(d,t,m,h,f)):function(e,t,n,r,s,i,a,l,u,d,f,h,m){!function(e,t,n,r,s,i,a,l,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:s++,f++;break;case 1:d.push(r[s]),o(t,n,r,s++,s,f<l?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:c(t,i,a++,a)}}(function(e,t,n,r,o,s,i){var a,l,c,u,d,p,f=n+s,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(l=(c=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;c<s&&l<n&&i(r[o+c],e[t+l]);)c++,l++;if(c===s&&l===n)break e;d[b+a]=c}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<c&&0<l&&i(r[o+c-1],e[t+l-1]);)m[g--]=0,c--,l--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=c-l)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,i,a,l,d,h)||function(e,t,n,r,o,s,i,a){var l=0,c=r<a?r:a,u=Array(c++),d=Array(c);d[0]=-1;for(var f=1;f<c;f++)d[f]=i;for(var h=o.slice(s,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(l=p(d,c,g=b+s))&&(d[l]=g,u[l]={newi:m,oldi:g,prev:u[l-1]})}for(l=--c,--i;d[l]>i;)--l;c=a+r-l;var w=Array(c),y=u[l];for(--n;y;){for(var v=y.newi,x=y.oldi;v<n;)w[--c]=1,--n;for(;x<i;)w[--c]=-1,--i;w[--c]=0,--n,--i,y=y.prev}for(;t<=n;)w[--c]=1,--n;for(;s<=i;)w[--c]=-1,--i;return w}(n,r,s,i,a,l,u,d),e,t,n,r,a,l,f,m)}(d,e,n,w,b,k,t,g,m,x,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,w={};try{w.Map=Map}catch(u){w.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var s=r(o);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,s){return n[r(o)?e:t.push(o)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var y=w.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,S,E,C,L,A={},T={},R=[],N=T.hasOwnProperty,z=0,j={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(z=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<z;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},P=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),I=(S=e,E="fragment",L="content"in D(C="template")?function(e){var t=D(C);return t.innerHTML=e,t.content}:function(e){var t,n=D(E),r=D(C);return O(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=D(E),n=D("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",O(t,n.firstChild.childNodes),t}:L)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function D(e){return e===E?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,B,F,W,U,H,G,V,Z=(M="appendChild",B="cloneNode",F="createTextNode",U=(W="importNode")in(q=e),(H=q.createDocumentFragment())[M](q[F]("g")),H[M](q[F]("")),(U?q[W](H,!0):H[B](!0)).childNodes.length<2?function e(t,n){for(var r=t[B](),o=t.childNodes||[],s=o.length,i=0;n&&i<s;i++)r[M](e(o[i],n));return r}:U?q[W]:function(e,t){return e[B](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Q="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Q+'"></p>',G.content.childNodes[0].getAttribute(V)==Q)||(Q="_dt: "+Q.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Q+"--\x3e",Y=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",se="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",ie=new RegExp(oe+re+se+"+)(["+te+"]*/?>)","g"),ae=new RegExp(oe+re+se+"*)(["+te+"]*/>)","g"),le=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+Q+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a<i;){var l=s[a];switch(l.nodeType){case 1:var c=o.concat(a);!function(t,n,r,o){for(var s,i=t.attributes,a=[],l=[],c=pe(i,r),u=c.length,d=0;d<u;){var p=c[d++],f=p.value===Q;if(f||1<(s=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(he(g,o,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(he(g,o,m,s))}}l.push(p)}}for(var w=((d=0)<(u=l.length)&&J&&!("ownerSVGElement"in t));d<u;){var y=l[d++];w&&(y.value=""),t.removeAttribute(y.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=i.length,d=0;d<u;)x.setAttributeNode(i[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(l,n,r,c),fe(l,n,r,c);break;case 8:var u=l.textContent;if(u===Q)r.shift(),n.push(Y.test(t.nodeName)?me(t,o):{type:"any",node:l,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),a--,i--}break;case 3:Y.test(t.nodeName)&&K.call(l.textContent)===X&&(r.shift(),n.push(me(t,o)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function we(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(ie,ce)})(t),r=e.transform;r&&(n=r(n));var o=I(n,e.type);ve(o);var s=[];return fe(o,s,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=s.length,i=0,a=0;i<o;){var l=s[i++],c=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,l.path);switch(l.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=l.sparse,d=e.attribute(c,l.name,l.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var s=1,i=1;s<e;){var a=r[s-i];if(a.sparse){var l=a.values,c=l[0],u=1,d=l.length;for(i+=d-2;u<d;)c+=arguments[s++]+l[u++];a.fn(c)}else a.fn(arguments[s++])}return n}}}}var ye=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var xe,ke,$e=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(o){var s,i,a,l;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(i in r)i in o||(e[i]="")}else t?e.value="":e.cssText="";for(i in s=t?{}:e,o)a="number"!=typeof(l=o[i])||xe.test(i)?l:l+"px",!t&&/^--/.test(i)?s.setProperty(i,a):s[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=s):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Ee,Ce,Le=(Ee=[].slice,(Ce=Ae.prototype).ELEMENT_NODE=1,Ce.nodeType=111,Ce.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Ce.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,s=r.length;o<s;o++)t.appendChild(r[o]);return t},Ae);function Ae(e){var t=this.childNodes=Ee.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Me:return Re(e.render(),t);default:return e}}function Ne(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Te).then(t):Promise.resolve(j.invoke(e,t)).then(t)}function ze(e){return null!=e&&"then"in e}var je,Pe,Ie,Oe,De,qe="ownerSVGElement",Me=v.prototype.nodeType,Be=Le.prototype.nodeType,Fe=(Pe=(je={Event:b,WeakSet:u}).Event,Ie=je.WeakSet,Oe=!0,De=null,function(e){return Oe&&(Oe=!Oe,De=new Ie,function(e){var t=new Ie,n=new Ie;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],s=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){i(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){s({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){s({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,o=e.length,s=0;s<o;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,s=new Pe(t),i=e.length,a=0;a<i;1===(o=e[a++]).nodeType&&function e(t,n,r,o,s){De.has(t)&&!o.has(t)&&(s.delete(t),o.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,l=0;l<a;e(i[l++],n,r,o,s));}(o,s,t,n,r));}}(e.ownerDocument)),De.add(e),e}),We=/^(?:form|list)$/i,Ue=[].slice;function He(t){return this.type=t,function(t){var n=ye,r=ve;return function(o){var s,i,a;return n!==o&&(s=t,i=n=o,a=be.get(i)||be.set(i,we(s,i)),r=a.updates(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,o=qe in e;if("style"===t)return $e(e,n,o);if("."===t.slice(0,1))return c=e,u=t.slice(1),o?function(e){try{c[u]=e}catch(t){c.setAttribute(u,e)}}:function(e){c[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){l!==!!e&&((l=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?Fe(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!o&&t in e&&!We.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in j.attributes)return function(n){var o=j.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var i,a,l,c,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Re,before:e},o=qe in e?"svg":"html",s=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=h(e.parentNode,t,[(l=a,e.ownerDocument.createTextNode(l))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=h(e.parentNode,t,[],r);break}default:if(s=!1,P(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(P(a[0])&&(a=a.concat.apply([],a)),ze(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ue.call(a.childNodes):[a],r):ze(a)?a.then(i):"placeholder"in a?Ne(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ue.call(I([].concat(a.html).join(""),o).childNodes),r):i("length"in a?Ue.call(a):j.invoke(a,i))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?ze(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ue.call(r).join(""):j.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,o,s,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),l=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||l?(o={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Ve=l?s:(i=new n,function(e){return i.get(e)||(n=s(t=e),i.set(t,n),n);var t,n})):Ge=!0,Ze(t)};function Ze(e){return Ge?e:Ve(e)}function Ke(e){for(var t=arguments.length,n=[Ze(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Qe=new n,Je=function(e){var t,n,r;return function(){var o=Ke.apply(null,arguments);return r!==o[0]?(r=o[0],n=new He(e),t=Ye(n.apply(n,o))):n.apply(n,o),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Qe.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Qe.set(e,r={}),r[o]||(r[o]=Je(t))},Ye=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Le(t):e},et=new n;function tt(){var e=et.get(this),t=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(qe in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,ot,st,it=j.define,at=He.prototype;function lt(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?lt.bind(e):Xe(e,"html"):("raw"in e?Je("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=it,lt.diff=h,(lt.hyper=lt).observe=Fe,lt.tagger=at,lt.wire=function(e,t){return null==e?Je(t||"html"):Xe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,ot=Object.create,st=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var s,i,a,l=t.get(e)||st(e,t);switch(typeof o){case"object":case"function":var c=l.w||(l.w=new n);return c.get(o)||(s=c,i=o,a=new e(r),s.set(i,a),a);default:var u=l.p||(l.p=ot(null));return u[o]||(u[o]=new e(r))}}(this,rt.get(e)||(r=e,o=new y,rt.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",nt),svg:x("svg",nt),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),lt}(document); +/*! (c) Andrea Giammarchi (ISC) */const ye=we,ve=E,xe=he,ke=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",o=null,s=new Map,i="type",a=Array.from(e);for(let e=0;e<a.length;e++){const l=a[e];switch(i){case"type":if("/"===l){i="subtype";continue}t+=l;break;case"subtype":if(";"===l){i="param-start";continue}n+=l;break;case"param-start":if(L.test(l)||";"===l)continue;r+=l,i="param-name";break;case"param-name":if("="===l||";"===l){if("="===l){i="param-value",o=null;continue}s.set(r.toLowerCase(),null),r="";continue}r+=l;break;case"param-value":if('"'==l){i="collect-quoted-string";continue}if(";"===l){o=o.trimEnd(),i="param-start",T(s,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){T(s,r,o),i="ignore-input-until-next-param",r="",o=null;continue}if("\\"===l)continue;o="string"==typeof o?o+l:l;break;case"ignore-input-until-next-param":if(";"!==l)continue;i="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${i} `)}}r&&T(s,r,o);if(""===t.trim()||!C.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!C.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(s.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?C.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},$e=be;function _e(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Se=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Ee=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"});"en"===l||l.startsWith("en-");function Le(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Ae(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Te(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const Re=Te("conjunction"),Ne=Te("disjunction");function ze(e,t){return Re(e,t).join("")}function je(e){return e.trim().replace(/\s+/g," ")}function Pe(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Ie(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Xe(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function Oe(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>ye`${e}, `));return ye`${r}${n[n.length-1]}`}function De(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function qe(e){const t=new Set,n="ltNodefault"in e.dataset?"":je(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>je(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(je(e))))}return[...t]}function Me(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function Be(e,t){const n=t.closest(".informative, .note, .issue, .example, .ednote, .practice, .introductory");let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function Fe(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function We(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Ue(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class He extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Ge(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Me(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ve(t),t}function Ve(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ze(t)])e.remove()}function*Ze(e){for(;e.nextNode();)yield e.currentNode}class Ke extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Qe extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||De(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n}}}function Je(e,t,n={}){const o={...n,isWarning:!1};r("error",new Qe(e,t,o))}function Xe(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Qe(e,t,o))}function Ye(e){return e?`\`${e}\``:""}function et(e,{quotes:t}={quotes:!1}){return Ne(e,t?e=>Ye(tt(e)):Ye).join("")}function tt(e){return String(e)?`"${e}"`:""}function nt(e,...t){return _e(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,s]=r.slice(1,-1).split("|");if(s){return`${e}[${o}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}const rt=new Map([["text/html","html"],["application/xml","xml"]]);function ot(e,t=document){const n=rt.get(e);if(!n){const t=[...rt.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=st(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function st(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ve(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Ae(o);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=ye`<meta charset="utf-8" />`);s.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=ye` <meta name="generator" content="${l}" /> - `;o.appendChild(c),t.prepend(o),r("beforesave",i)}(n);let i="";if("xml"===e)i=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(i+=(new XMLSerializer).serializeToString(n.doctype)),i+=n.documentElement.outerHTML;return i}t("core/exporter",{rsDocToDataURL:it});class st{constructor(){this._respecDonePromise=new Promise((e=>{i("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],i("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),i("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return ot("html",document)}}const at="core/post-process";const lt="core/pre-process";const ct="core/base-runner";async function ut(e){!function(){const e=new st;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),i("amend-user-config",n),i("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of o)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let i;try{i=JSON.parse(r)}catch{i=r}return[n,i]})),i=Object.fromEntries(n);Object.assign(e,i),r("amend-user-config",i)}(respecConfig),performance.mark(`${ct}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `preProcess` must be a JS function.",lt),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`preProcess\`.`,lt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),respecConfig.state={},await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,i)=>{const o=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),i(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){i(e)}finally{clearTimeout(o),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},r("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `postProcess` must be a JS function.",at),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`postProcess\`.`,at,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Ae(document),performance.mark(`${ct}-end`),performance.measure(ct,`${ct}-start`,`${ct}-end`)}var dt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} + `;s.appendChild(c),t.prepend(s),r("beforesave",o)}(n);let o="";if("xml"===e)o=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(o+=(new XMLSerializer).serializeToString(n.doctype)),o+=n.documentElement.outerHTML;return o}t("core/exporter",{rsDocToDataURL:ot});class it{constructor(){this._respecDonePromise=new Promise((e=>{o("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],o("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),o("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return st("html",document)}}const at="core/post-process";const lt="core/pre-process";const ct="core/base-runner";async function ut(e){!function(){const e=new it;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),o("amend-user-config",n),o("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of s)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),o=Object.fromEntries(n);Object.assign(e,o),r("amend-user-config",o)}(respecConfig),performance.mark(`${ct}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `preProcess` must be a JS function.",lt),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`preProcess\`.`,lt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),respecConfig.state={},await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const s=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},r("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `postProcess` must be a JS function.",at),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`postProcess\`.`,at,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Ae(document),performance.mark(`${ct}-end`),performance.measure(ct,`${ct}-start`,`${ct}-end`)}var dt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} #respec-pill,.respec-info-button{height:2.4em;background:#fff;color:#787878;border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);padding:.2em 0} .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity} @@ -65,37 +65,37 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center} .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px} p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} -.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const pt=/>/gm,ft=/&/gm;class ht extends xe.Renderer{code(e,t,n){const{language:r,...i}=ht.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const o=super.code(e,r,n),{example:s,illegalExample:a}=i;if(!s&&!a)return o;const l=s||a,c=`${r} ${s?"example":"illegal-example"}`;return o.replace("<pre>",`<pre title="${l}" class="${c}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const pt=/>/gm,ft=/&/gm;class ht extends xe.Renderer{code(e,t,n){const{language:r,...o}=ht.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const s=super.code(e,r,n),{example:i,illegalExample:a}=o;if(!i&&!a)return s;const l=i||a,c=`${r} ${i?"example":"illegal-example"}`;return s.replace("<pre>",`<pre title="${l}" class="${c}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` <figure> <img src="${e}" alt="${n}" /> <figcaption>${t}</figcaption> </figure> - `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let i;if(r)try{i=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...i}}heading(e,t,n,r){const i=/(.+)\s+{#([\w-]+)}$/;if(i.test(e)){const[,n,r]=e.match(i);return`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}const mt={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new ht};function gt(e,t={inline:!1}){const n=_e(e).replace(pt,">").replace(ft,"&");return t.inline?xe.parseInline(n,mt):xe.parse(n,mt)}function bt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=gt(e.innerHTML)}const wt=(yt="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(yt);return t.forEach(bt),Array.from(t)});var yt;var vt=Object.freeze({__proto__:null,markdownToHtml:gt,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void wt(document.body);const r=document.getElementById("respec-ui");r.remove();const i=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),i=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),i.trim()){const t=Ue(e);e.append(`\n\n${t}`)}}}(i,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),bt(i),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(i.querySelectorAll(".nolinks a[href]")),i.append(r),document.body.replaceWith(i)}});function xt(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=dt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const kt=ye`<div id="respec-ui" class="removeOnSave" hidden></div>`,$t=ye`<ul + `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e,t,n,r){const o=/(.+)\s+{#([\w-]+)}$/;if(o.test(e)){const[,n,r]=e.match(o);return`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}const mt={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new ht};function gt(e,t={inline:!1}){const n=_e(e).replace(pt,">").replace(ft,"&");return t.inline?xe.parseInline(n,mt):xe.parse(n,mt)}function bt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=gt(e.innerHTML)}const wt=(yt="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(yt);return t.forEach(bt),Array.from(t)});var yt;var vt=Object.freeze({__proto__:null,markdownToHtml:gt,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void wt(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=Ue(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),bt(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function xt(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=dt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const kt=ye`<div id="respec-ui" class="removeOnSave" hidden></div>`,$t=ye`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" hidden ></ul>`,_t=ye`<button class="close-button" - onclick=${()=>It.closeModal()} + onclick=${()=>Pt.closeModal()} title="Close" > ❌ -</button>`;let St,Et;window.addEventListener("load",(()=>Nt($t)));const Ct=[],Lt=[],At={};i("start-all",(()=>document.body.prepend(kt)),{once:!0}),i("end-all",(()=>document.body.prepend(kt)),{once:!0});const Tt=ye`<button id="respec-pill" disabled>ReSpec</button>`;function Rt(){$t.classList.toggle("respec-hidden"),$t.classList.toggle("respec-visible"),$t.hidden=!$t.hidden}function Nt(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}kt.appendChild(Tt),Tt.addEventListener("click",(e=>{e.stopPropagation(),Tt.setAttribute("aria-expanded",String($t.hidden)),Rt(),$t.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{$t.hidden||Rt()})),kt.appendChild($t),$t.addEventListener("keydown",(e=>{"Escape"!==e.key||$t.hidden||(Tt.setAttribute("aria-expanded",String($t.hidden)),Rt(),Tt.focus())}));const jt=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function zt(e,t,n,r){t.push(e),At.hasOwnProperty(n)||(At[n]=function(e,t,n){const r=ye`<button +</button>`;let St,Et;window.addEventListener("load",(()=>Nt($t)));const Ct=[],Lt=[],At={};o("start-all",(()=>document.body.prepend(kt)),{once:!0}),o("end-all",(()=>document.body.prepend(kt)),{once:!0});const Tt=ye`<button id="respec-pill" disabled>ReSpec</button>`;function Rt(){$t.classList.toggle("respec-hidden"),$t.classList.toggle("respec-visible"),$t.hidden=!$t.hidden}function Nt(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}kt.appendChild(Tt),Tt.addEventListener("click",(e=>{e.stopPropagation(),Tt.setAttribute("aria-expanded",String($t.hidden)),Rt(),$t.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{$t.hidden||Rt()})),kt.appendChild($t),$t.addEventListener("keydown",(e=>{"Escape"!==e.key||$t.hidden||(Tt.setAttribute("aria-expanded",String($t.hidden)),Rt(),Tt.focus())}));const zt=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function jt(e,t,n,r){t.push(e),At.hasOwnProperty(n)||(At[n]=function(e,t,n){const r=ye`<button id="${`respec-pill-${e}`}" class="respec-info-button" - ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const i=ye`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(Pt(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),i.appendChild(n)}It.freshModal(n,i,r)}));const i=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return xt(r,i),r}(n,t,r),kt.appendChild(At[n]));const i=At[n];i.textContent=t.length;const o=1===t.length?$e.singular(r):r;xt(i,new Map([["label",`${t.length} ${o}`]]))}xt(Tt,jt);const It={show(){try{kt.hidden=!1}catch(e){console.error(e)}},hide(){kt.hidden=!0},enable(){Tt.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const i=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,o=ye`<button id="${i}" class="respec-option"> + ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=ye`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(It(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),o.appendChild(n)}Pt.freshModal(n,o,r)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return xt(r,o),r}(n,t,r),kt.appendChild(At[n]));const o=At[n];o.textContent=t.length;const s=1===t.length?$e.singular(r):r;xt(o,new Map([["label",`${t.length} ${s}`]]))}xt(Tt,zt);const Pt={show(){try{kt.hidden=!1}catch(e){console.error(e)}},hide(){kt.hidden=!0},enable(){Tt.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=ye`<button id="${o}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}… - </button>`,s=ye`<li role="menuitem">${o}</li>`;return s.addEventListener("click",t),$t.appendChild(s),o},error(e){zt(e,Ct,"error","ReSpec Errors")},warning(e){zt(e,Lt,"warning","ReSpec Warnings")},closeModal(e){Et&&(Et.classList.remove("respec-show-overlay"),Et.classList.add("respec-hide-overlay"),Et.addEventListener("transitionend",(()=>{Et.remove(),Et=null}))),e&&e.setAttribute("aria-expanded","false"),St&&(St.remove(),St=null,Tt.focus())},freshModal(e,t,n){St&&St.remove(),Et&&Et.remove(),Et=ye`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,i=`${r}-heading`;St=ye`<div + </button>`,i=ye`<li role="menuitem">${s}</li>`;return i.addEventListener("click",t),$t.appendChild(i),s},error(e){jt(e,Ct,"error","ReSpec Errors")},warning(e){jt(e,Lt,"warning","ReSpec Warnings")},closeModal(e){Et&&(Et.classList.remove("respec-show-overlay"),Et.classList.add("respec-hide-overlay"),Et.addEventListener("transitionend",(()=>{Et.remove(),Et=null}))),e&&e.setAttribute("aria-expanded","false"),St&&(St.remove(),St=null,Tt.focus())},freshModal(e,t,n){St&&St.remove(),Et&&Et.remove(),Et=ye`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;St=ye`<div id="${r}" class="respec-modal removeOnSave" role="dialog" - aria-labelledby="${i}" + aria-labelledby="${o}" > ${_t} - <h3 id="${i}">${e}</h3> + <h3 id="${o}">${e}</h3> <div class="inside">${t}</div> - </div>`;const o=new Map([["labelledby",i]]);xt(St,o),document.body.append(Et,St),Et.addEventListener("click",(()=>this.closeModal(n))),Et.classList.toggle("respec-show-overlay"),St.hidden=!1,Nt(St)}};function Pt(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${gt(`<p class="respec-hint"><strong>How to fix:</strong> ${_e(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${gt(e.elements.map(Ot).join("\n"))}`:"",i=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${gt(`**${e.message}**`,{inline:!0})}${n}${r}${i}${t}`}function Ot(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function Dt(e){try{It.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await ut(e)}finally{It.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&It.closeModal()})),window.respecUI=It,i("error",(e=>It.error(e))),i("warn",(e=>It.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const qt=[Promise.resolve().then((function(){return Mt})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Ut})),Promise.resolve().then((function(){return Vt})),Promise.resolve().then((function(){return Xt})),Promise.resolve().then((function(){return en})),Promise.resolve().then((function(){return an})),Promise.resolve().then((function(){return mn})),Promise.resolve().then((function(){return vt})),Promise.resolve().then((function(){return Se})),Promise.resolve().then((function(){return gn})),Promise.resolve().then((function(){return Sr})),Promise.resolve().then((function(){return Pr})),Promise.resolve().then((function(){return Or})),Promise.resolve().then((function(){return Br})),Promise.resolve().then((function(){return Gr})),Promise.resolve().then((function(){return Jr})),Promise.resolve().then((function(){return ei})),Promise.resolve().then((function(){return Gn})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return ui})),Promise.resolve().then((function(){return rr})),Promise.resolve().then((function(){return xi})),Promise.resolve().then((function(){return dn})),Promise.resolve().then((function(){return ki})),Promise.resolve().then((function(){return Ti})),Promise.resolve().then((function(){return Ni})),Promise.resolve().then((function(){return zi})),Promise.resolve().then((function(){return Ii})),Promise.resolve().then((function(){return Mi})),Promise.resolve().then((function(){return Ui})),Promise.resolve().then((function(){return Qi})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return io})),Promise.resolve().then((function(){return po})),Promise.resolve().then((function(){return bo})),Promise.resolve().then((function(){return $o})),Promise.resolve().then((function(){return So})),Promise.resolve().then((function(){return jo})),Promise.resolve().then((function(){return Po})),Promise.resolve().then((function(){return qo})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return Vo})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return Yo})),Promise.resolve().then((function(){return ns})),Promise.resolve().then((function(){return os}))];Promise.all(qt).then((e=>Dt(e))).catch((e=>console.error(e)));var Mt=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash=`#${e}`}))}});const Bt={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Ft=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["cc-by-nd",{name:"Creative Commons Attribution-NoDerivatives 4.0 International Public License",short:"CC-BY-ND",url:"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl"}]]),Wt={lint:{"privsec-section":!0},doJsonLd:!0,license:"cc-by",specStatus:"GN-BASIS",logos:[{src:"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg",alt:"Geonovum",id:"Geonovum",height:67,width:132,url:"https://www.geonovum.nl/"}]};var Ut=Object.freeze({__proto__:null,name:"geonovum/defaults",run:function(e){const t=!1!==e.lint&&{...Bt.lint,...Wt.lint,...e.lint};Object.assign(e,{...Bt,...Wt,...e,lint:t}),Object.assign(e,function(e){return{isCCBY:"cc-by"===e.license,licenseInfo:Ft.get(e.license),isBasic:"GN-BASIS"===e.specStatus,isRegular:"GN-BASIS"===e.specStatus}}(e))}});var Ht=String.raw`@keyframes pop{ + </div>`;const s=new Map([["labelledby",o]]);xt(St,s),document.body.append(Et,St),Et.addEventListener("click",(()=>this.closeModal(n))),Et.classList.toggle("respec-show-overlay"),St.hidden=!1,Nt(St)}};function It(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${gt(`<p class="respec-hint"><strong>How to fix:</strong> ${_e(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${gt(e.elements.map(Ot).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${gt(`**${e.message}**`,{inline:!0})}${n}${r}${o}${t}`}function Ot(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function Dt(e){try{Pt.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await ut(e)}finally{Pt.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&Pt.closeModal()})),window.respecUI=Pt,o("error",(e=>Pt.error(e))),o("warn",(e=>Pt.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const qt=[Promise.resolve().then((function(){return Mt})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Ut})),Promise.resolve().then((function(){return Vt})),Promise.resolve().then((function(){return Xt})),Promise.resolve().then((function(){return en})),Promise.resolve().then((function(){return an})),Promise.resolve().then((function(){return mn})),Promise.resolve().then((function(){return vt})),Promise.resolve().then((function(){return Se})),Promise.resolve().then((function(){return gn})),Promise.resolve().then((function(){return Sr})),Promise.resolve().then((function(){return Ir})),Promise.resolve().then((function(){return Or})),Promise.resolve().then((function(){return Br})),Promise.resolve().then((function(){return Gr})),Promise.resolve().then((function(){return Jr})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return Gn})),Promise.resolve().then((function(){return vo})),Promise.resolve().then((function(){return uo})),Promise.resolve().then((function(){return rr})),Promise.resolve().then((function(){return ko})),Promise.resolve().then((function(){return dn})),Promise.resolve().then((function(){return $o})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return zo})),Promise.resolve().then((function(){return Po})),Promise.resolve().then((function(){return Io})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return Ho})),Promise.resolve().then((function(){return Jo})),Promise.resolve().then((function(){return Xo})),Promise.resolve().then((function(){return ss})),Promise.resolve().then((function(){return ps})),Promise.resolve().then((function(){return bs})),Promise.resolve().then((function(){return $s})),Promise.resolve().then((function(){return Ss})),Promise.resolve().then((function(){return zs})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return qs})),Promise.resolve().then((function(){return Ws})),Promise.resolve().then((function(){return Vs})),Promise.resolve().then((function(){return Qs})),Promise.resolve().then((function(){return Ys})),Promise.resolve().then((function(){return ni})),Promise.resolve().then((function(){return si}))];Promise.all(qt).then((e=>Dt(e))).catch((e=>console.error(e)));var Mt=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash=`#${e}`}))}});const Bt={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Ft=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["cc-by-nd",{name:"Creative Commons Attribution-NoDerivatives 4.0 International Public License",short:"CC-BY-ND",url:"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl"}]]),Wt={lint:{"privsec-section":!0},doJsonLd:!0,license:"cc-by",specStatus:"GN-BASIS",logos:[{src:"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg",alt:"Geonovum",id:"Geonovum",height:67,width:132,url:"https://www.geonovum.nl/"}]};var Ut=Object.freeze({__proto__:null,name:"geonovum/defaults",run:function(e){const t=!1!==e.lint&&{...Bt.lint,...Wt.lint,...e.lint};Object.assign(e,{...Bt,...Wt,...e,lint:t}),Object.assign(e,function(e){return{isCCBY:"cc-by"===e.license,licenseInfo:Ft.get(e.license),isBasic:"GN-BASIS"===e.specStatus,isRegular:"GN-BASIS"===e.specStatus}}(e))}});var Ht=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -150,7 +150,7 @@ dd{margin-left:0} } @media print{ .removeOnSave{display:none} -}`;const Gt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Ht,document.head.appendChild(e),e}();var Vt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Gt.remove()}});const Zt="geonovum/style";function Kt(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=`https://tools.geostandaarden.nl/respec/style/${e}.css`,t}const Qt=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preconnect",href:"https://tools.geostandaarden.nl/"},{hint:"preload",href:"https://tools.geostandaarden.nl/respec/style/base.css",as:"style"},{hint:"preload",href:"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg",as:"image"}],t=document.createDocumentFragment();for(const n of e.map(Le))t.appendChild(n);return t}(),Jt=document.createElement("link");Jt.rel="shortcut icon",Jt.type="image/x-icon",Jt.href="https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico",document.head.prepend(Jt),document.head.querySelector("meta[name=viewport]")||Qt.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Qt);var Xt=Object.freeze({__proto__:null,name:Zt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.";e.specStatus="GN-BASIS",Xe(t,Zt)}document.body.querySelector("figure.scalable")&&(document.head.appendChild(Kt("leaflet")),document.head.appendChild(Kt("font-awesome")));let t="";switch(e.specStatus.toUpperCase()){case"GN-WV":t+="GN-WV.css";break;case"GN-CV":t+="GN-CV.css";break;case"GN-VV":t+="GN-VV.css";break;case"GN-DEF":t+="GN-DEF.css";break;case"GN-BASIS":t+="GN-BASIS.css";break;default:t="base.css"}e.noToc||i("end-all",(()=>{!function(e,t){const n=e.createElement("script");n.addEventListener("load",(()=>{window.location.hash&&(window.location.href=window.location.hash)}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0}),function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,`https://tools.geostandaarden.nl/respec/style/${t}`)}});const Yt={en:{status_at_publication:ye`This section describes the status of this +}`;const Gt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Ht,document.head.appendChild(e),e}();var Vt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Gt.remove()}});const Zt="geonovum/style";function Kt(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=`https://tools.geostandaarden.nl/respec/style/${e}.css`,t}const Qt=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preconnect",href:"https://tools.geostandaarden.nl/"},{hint:"preload",href:"https://tools.geostandaarden.nl/respec/style/base.css",as:"style"},{hint:"preload",href:"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg",as:"image"}],t=document.createDocumentFragment();for(const n of e.map(Le))t.appendChild(n);return t}(),Jt=document.createElement("link");Jt.rel="shortcut icon",Jt.type="image/x-icon",Jt.href="https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico",document.head.prepend(Jt),document.head.querySelector("meta[name=viewport]")||Qt.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Qt);var Xt=Object.freeze({__proto__:null,name:Zt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.";e.specStatus="GN-BASIS",Xe(t,Zt)}document.body.querySelector("figure.scalable")&&(document.head.appendChild(Kt("leaflet")),document.head.appendChild(Kt("font-awesome")));let t="";switch(e.specStatus.toUpperCase()){case"GN-WV":t+="GN-WV.css";break;case"GN-CV":t+="GN-CV.css";break;case"GN-VV":t+="GN-VV.css";break;case"GN-DEF":t+="GN-DEF.css";break;case"GN-BASIS":t+="GN-BASIS.css";break;default:t="base.css"}e.noToc||o("end-all",(()=>{!function(e,t){const n=e.createElement("script");n.addEventListener("load",(()=>{window.location.hash&&(window.location.href=window.location.hash)}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0}),function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,`https://tools.geostandaarden.nl/respec/style/${t}`)}});const Yt={en:{status_at_publication:ye`This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current Geonovum publications and the latest revision of this document can be found via @@ -162,89 +162,89 @@ dd{margin-left:0} laatste gepubliceerde versie van dit document zijn te vinden op <a href="https://www.geonovum.nl/geo-standaarden/alle-standaarden" >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a - >.`}};Object.keys(Yt).forEach((e=>{a[e]||(a[e]={}),Object.assign(a[e],Yt[e])}));var en=Object.freeze({__proto__:null,name:"geonovum/l10n"});const tn="core/github";let nn,rn;const on=new Promise(((e,t)=>{nn=e,rn=e=>{Je(e,tn),t(new Error(e))}})),sn=Ie({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var an=Object.freeze({__proto__:null,github:on,name:tn,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void nn(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=nt`Config option ${"[github]"} is missing property \`repoURL\`.`;return void rn(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=nt`${"[github]"} configuration option is not a valid URL? (${n}).`;return void rn(e)}if("https://github.com"!==t.origin){const e=nt`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void rn(e)}const[r,i]=t.pathname.split("/").filter((e=>e));if(!r||!i){const e=nt`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void rn(e)}const o=e.github.branch||"gh-pages",s=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),l={edDraftURI:`https://${r.toLowerCase()}.github.io/${i}/`,githubToken:void 0,githubUser:void 0,issueBase:s,atRiskBase:s,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:i};let c="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)c=e.githubAPI;else{Xe("The `githubAPI` configuration option is private and should not be added manually.",tn)}if(!e.excludeGithubLinks){const n={key:sn.participate,data:[{value:`GitHub ${r}/${i}`,href:t},{value:sn.file_a_bug,href:l.issueBase},{value:sn.commit_history,href:a.href},{value:"Pull requests",href:l.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:o,repoURL:t.href,apiBase:c,fullName:`${r}/${i}`,issuesURL:s,pullsURL:l.pullBase,newIssuesURL:new URL("./new/choose",s).href,commitHistoryURL:a.href};nn(u);const d={...l,...e,github:u,githubAPI:c};Object.assign(e,d)}});class ln{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(cn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function cn(e){const t=new ln(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function un(e){const t=cn(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var dn=Object.freeze({__proto__:null,name:"core/sections",restructure:un,run:function(){un(document.body)}});const pn="core/data-include";function fn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),i=Pe(e,r.dataset.oninclude,n),o="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let i=t;"markdown"===r&&(i=gt(i)),"text"===r?e.textContent=i:e.innerHTML=i,"markdown"===r&&un(e),n&&e.replaceWith(...e.childNodes)}(r,i,{replace:o}),o||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function hn(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const i=await fetch(n);fn(await i.text(),r,n),t<3&&await hn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Je(r,pn,{elements:[e]})}}));await Promise.all(r)}var mn=Object.freeze({__proto__:null,name:pn,run:async function(){await hn(document,1)}});var gn=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Pe(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const bn=/^[a-z]+(\s+[a-z]+)+\??$/,wn=/\B"([^"]*)"\B/,yn=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,vn=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,xn=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,kn=/^(?:\w+)\??$/,$n=/^(\w+)\["([\w- ]*)"\]$/,_n=/\.?(\w+\(.*\)$)/,Sn=/\/(.+)/,En=/\[\[.+\]\]/;function Cn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return ye`<a + >.`}};Object.keys(Yt).forEach((e=>{a[e]||(a[e]={}),Object.assign(a[e],Yt[e])}));var en=Object.freeze({__proto__:null,name:"geonovum/l10n"});const tn="core/github";let nn,rn;const on=new Promise(((e,t)=>{nn=e,rn=e=>{Je(e,tn),t(new Error(e))}})),sn=Pe({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var an=Object.freeze({__proto__:null,github:on,name:tn,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void nn(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=nt`Config option ${"[github]"} is missing property \`repoURL\`.`;return void rn(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=nt`${"[github]"} configuration option is not a valid URL? (${n}).`;return void rn(e)}if("https://github.com"!==t.origin){const e=nt`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void rn(e)}const[r,o]=t.pathname.split("/").filter((e=>e));if(!r||!o){const e=nt`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void rn(e)}const s=e.github.branch||"gh-pages",i=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),l={edDraftURI:`https://${r.toLowerCase()}.github.io/${o}/`,githubToken:void 0,githubUser:void 0,issueBase:i,atRiskBase:i,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:o};let c="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)c=e.githubAPI;else{Xe("The `githubAPI` configuration option is private and should not be added manually.",tn)}if(!e.excludeGithubLinks){const n={key:sn.participate,data:[{value:`GitHub ${r}/${o}`,href:t},{value:sn.file_a_bug,href:l.issueBase},{value:sn.commit_history,href:a.href},{value:"Pull requests",href:l.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:s,repoURL:t.href,apiBase:c,fullName:`${r}/${o}`,issuesURL:i,pullsURL:l.pullBase,newIssuesURL:new URL("./new/choose",i).href,commitHistoryURL:a.href};nn(u);const d={...l,...e,github:u,githubAPI:c};Object.assign(e,d)}});class ln{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(cn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function cn(e){const t=new ln(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function un(e){const t=cn(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var dn=Object.freeze({__proto__:null,name:"core/sections",restructure:un,run:function(){un(document.body)}});const pn="core/data-include";function fn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=Ie(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=gt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&un(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function hn(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);fn(await o.text(),r,n),t<3&&await hn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Je(r,pn,{elements:[e]})}}));await Promise.all(r)}var mn=Object.freeze({__proto__:null,name:pn,run:async function(){await hn(document,1)}});var gn=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Ie(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const bn=/^[a-z]+(\s+[a-z]+)+\??$/,wn=/\B"([^"]*)"\B/,yn=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,vn=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,xn=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,kn=/^(?:\w+)\??$/,$n=/^(\w+)\["([\w- ]*)"\]$/,_n=/\.?(\w+\(.*\)$)/,Sn=/\/(.+)/,En=/\[\[.+\]\]/;function Cn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return ye`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></a - >`}function Ln(e){const{identifier:t,parent:n,slotType:r,renderParent:i,args:o}=e,{identifier:s}=n||{},a="method"===r,l=a?ye`(${Oe(o,An)})`:null,c=a?`(${o.join(", ")})`:"";return ye`${n&&i?".":""}<a + >`}function Ln(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,l=a?ye`(${Oe(s,An)})`:null,c=a?`(${s.join(", ")})`:"";return ye`${n&&o?".":""}<a data-xref-type="${r}" data-link-type="${r}" - data-link-for="${s}" - data-xref-for="${s}" + data-link-for="${i}" + data-xref-for="${i}" data-lt="${`[[${t}]]${c}`}" ><code>[[${t}]]${l}</code></a - >`}function An(e,t,n){if(t<n.length-1)return ye`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),i=r.length>1,o=i?r[2]:r[0];return ye`${i?"...":null}<var>${o}</var>`}function Tn(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:i}=t||{};return ye`${r?".":""}<a + >`}function An(e,t,n){if(t<n.length-1)return ye`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return ye`${o?"...":null}<var>${s}</var>`}function Tn(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return ye`${r?".":""}<a data-link-type="idl" data-xref-type="attribute|dict-member|const" - data-link-for="${i}" - data-xref-for="${i}" + data-link-for="${o}" + data-xref-for="${o}" ><code>${n}</code></a - >`}function Rn(e){const{args:t,identifier:n,type:r,parent:i,renderParent:o}=e,{renderText:s,renderArgs:a}=e,{identifier:l}=i||{},c=Oe(a||t,An),u=`${n}(${t.join(", ")})`;return ye`${i&&o?".":""}<a + >`}function Rn(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:l}=o||{},c=Oe(a||t,An),u=`${n}(${t.join(", ")})`;return ye`${o&&s?".":""}<a data-link-type="idl" data-xref-type="${r}" data-link-for="${l}" data-xref-for="${l}" data-lt="${u}" - ><code>${s||n}</code></a - >${!s||a?ye`<code>(${c})</code>`:""}`}function Nn(e){const{identifier:t,enumValue:n,parent:r}=e,i=r?r.identifier:t;return ye`"<a + ><code>${i||n}</code></a + >${!i||a?ye`<code>(${c})</code>`:""}`}function Nn(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return ye`"<a data-link-type="idl" data-xref-type="enum-value" - data-link-for="${i}" - data-xref-for="${i}" + data-link-for="${o}" + data-xref-for="${o}" data-lt="${n?null:"the-empty-string"}" ><code>${n}</code></a - >"`}function jn(e){const{identifier:t}=e;return ye`"<a + >"`}function zn(e){const{identifier:t}=e;return ye`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function zn(e){const{identifier:t,nullable:n}=e;return ye`<a + >"`}function jn(e){const{identifier:t,nullable:n}=e;return ye`<a data-link-type="idl" data-cite="webidl" data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function In(e){let t;try{t=function(e){const t=En.test(e),n=t?Sn:_n,[r,i]=e.split(n);if(t&&r&&!i)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const o=r.split(/[./]/).concat(i).filter((e=>e&&e.trim())).map((e=>e.trim())),s=!e.includes("/"),a=[];for(;o.length;){const t=o.pop();if(yn.test(t)){const[,e,n,r,i]=t.match(yn),o=n.split(/,\s*/).filter((e=>e)),l=r?.trim(),c=i?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:o,renderParent:s,renderText:l,renderArgs:c})}else if($n.test(t)){const[,e,n]=t.match($n);a.push({type:"enum",identifier:e,enumValue:n,renderParent:s})}else if(wn.test(t)){const[,e]=t.match(wn);s?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:s})}else if(vn.test(t)){const[,e,n]=t.match(vn),r=n?"method":"attribute",i=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:i,renderParent:s})}else if(xn.test(t)&&o.length){const[,e]=t.match(xn);a.push({type:"attribute",identifier:e,renderParent:s})}else if(bn.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:s,nullable:e})}else{if(!kn.test(t)||0!==o.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:s,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=ye`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Je(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=ye(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Cn(e);t&&r.push(t);break}case"attribute":r.push(Tn(e));break;case"internal-slot":r.push(Ln(e));break;case"method":r.push(Rn(e));break;case"enum":r.push(Nn(e));break;case"exception":r.push(jn(e));break;case"idl-primitive":r.push(zn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Pn=new Set(["alias","reference"]),On=async function(){const e=await ve.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map((t=>e.deleteObjectStore(t)));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...Pn]){const r=e.transaction(n,"readwrite").store,i=IDBKeyRange.lowerBound(t);let o=await r.openCursor(i);for(;o?.value;){const e=o.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),o=await o.continue()}}return e}();const Dn={get ready(){return On},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Pn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Pn.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),i=await n.openCursor(r);return i?i.value:i},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const i={id:r,...e[r],expires:t};i.aliasOf?n.alias.push(i):n.reference.push(i)}const r=[...Pn].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Pn.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){if((await this.get(e,t.id))?.expires<Date.now()){const{store:i}=n.transaction(e,"readwrite");await i.delete(t.id),r=!1}}const{store:i}=n.transaction(e,"readwrite");return r?await i.put(t):await i.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Pn],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},qn={},Mn=new URL("https://api.specref.org/bibrefs?refs="),Bn=Le({hint:"dns-prefetch",href:Mn.origin});let Fn;document.head.appendChild(Bn);const Wn=new Promise((e=>{Fn=e}));async function Un(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(Mn.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const i=await r.json(),o=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),o):o;await Dn.addAll(i,e)}catch(e){console.error(e)}return i}async function Hn(e){const t=await Wn;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Hn(n.aliasOf):n}var Gn=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=qn;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await Dn.ready;const n=e.map((async e=>({id:e,data:await Dn.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],i={hasData:[],noData:[]};r.forEach((e=>{(e.data?i.hasData:i.noData).push(e)})),i.hasData.forEach((e=>{qn[e.id]=e.data}));const o=i.noData.map((e=>e.id));if(o.length){const e=await Un(o,{forceUpdate:!0});Object.assign(qn,e)}Object.assign(qn,this.conf.localBiblio),(()=>{Fn(this.conf.biblio)})()}},biblio:qn,name:"core/biblio",resolveRef:Hn,updateFromNetwork:Un});const Vn="core/render-biblio",Zn=Ie({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"}}),Kn=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PER","W3C Proposed Edited Recommendation"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),Qn=(Jn=".",e=>{const t=e.trim();return!t||t.endsWith(Jn)?t:t+Jn});var Jn;function Xn(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(Yn)),i=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),o=i.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),s=ye`<section> + >`}function Pn(e){let t;try{t=function(e){const t=En.test(e),n=t?Sn:_n,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;s.length;){const t=s.pop();if(yn.test(t)){const[,e,n,r,o]=t.match(yn),s=n.split(/,\s*/).filter((e=>e)),l=r?.trim(),c=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:s,renderParent:i,renderText:l,renderArgs:c})}else if($n.test(t)){const[,e,n]=t.match($n);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(wn.test(t)){const[,e]=t.match(wn);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(vn.test(t)){const[,e,n]=t.match(vn),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:i})}else if(xn.test(t)&&s.length){const[,e]=t.match(xn);a.push({type:"attribute",identifier:e,renderParent:i})}else if(bn.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:i,nullable:e})}else{if(!kn.test(t)||0!==s.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:i,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=ye`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Je(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=ye(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Cn(e);t&&r.push(t);break}case"attribute":r.push(Tn(e));break;case"internal-slot":r.push(Ln(e));break;case"method":r.push(Rn(e));break;case"enum":r.push(Nn(e));break;case"exception":r.push(zn(e));break;case"idl-primitive":r.push(jn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const In=new Set(["alias","reference"]),On=async function(){const e=await ve.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map((t=>e.deleteObjectStore(t)));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...In]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let s=await r.openCursor(o);for(;s?.value;){const e=s.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),s=await s.continue()}}return e}();const Dn={get ready(){return On},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!In.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!In.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...In].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!In.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){if((await this.get(e,t.id))?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...In],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},qn={},Mn=new URL("https://api.specref.org/bibrefs?refs="),Bn=Le({hint:"dns-prefetch",href:Mn.origin});let Fn;document.head.appendChild(Bn);const Wn=new Promise((e=>{Fn=e}));async function Un(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(Mn.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),s=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),s):s;await Dn.addAll(o,e)}catch(e){console.error(e)}return o}async function Hn(e){const t=await Wn;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Hn(n.aliasOf):n}var Gn=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=qn;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await Dn.ready;const n=e.map((async e=>({id:e,data:await Dn.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{qn[e.id]=e.data}));const s=o.noData.map((e=>e.id));if(s.length){const e=await Un(s,{forceUpdate:!0});Object.assign(qn,e)}Object.assign(qn,this.conf.localBiblio),(()=>{Fn(this.conf.biblio)})()}},biblio:qn,name:"core/biblio",resolveRef:Hn,updateFromNetwork:Un});const Vn="core/render-biblio",Zn=Pe({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"}}),Kn=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PER","W3C Proposed Edited Recommendation"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),Qn=(Jn=".",e=>{const t=e.trim();return!t||t.endsWith(Jn)?t:t+Jn});var Jn;function Xn(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(Yn)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),s=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=ye`<section> <h3>${t}</h3> - <dl class="bibliography">${o.map(tr)}</dl> - </section>`;De(s,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,i=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(i),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(i,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Je(`Reference "[${t}]" not found.`,Vn,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),s}function Yn(e){let t=qn[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Je(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Vn)}else n=t.aliasOf,t=qn[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function er(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,i=ye`<cite + <dl class="bibliography">${s.map(tr)}</dl> + </section>`;De(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Je(`Reference "[${t}]" not found.`,Vn,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function Yn(e){let t=qn[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Je(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Vn)}else n=t.aliasOf,t=qn[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function er(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=ye`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?i:ye`[${i}]`}function tr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return ye` + >`;return t?o:ye`[${o}]`}function tr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return ye` <dt id="${r}">[${t}]</dt> <dd> ${n?{html:nr(n)}:ye`<em class="respec-offending-element" >${Zn.reference_not_found}</em >`} </dd> - `}function nr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${Qn(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Kn.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var rr=Object.freeze({__proto__:null,name:Vn,renderInlineCitation:er,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||ye`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(ye`<h1>${Zn.references}</h1>`),r.classList.add("appendix"),n.length){const e=Xn(n,Zn.norm_references);r.appendChild(e)}if(t.length){const e=Xn(t,Zn.info_references);r.appendChild(e)}document.body.appendChild(r)}});const ir="core/inlines",or={},sr=e=>new RegExp(e.map((e=>e.source)).join("|")),ar=Ie({en:{rfc2119Keywords:()=>sr([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY?\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>sr([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),lr=/(?:`[^`]+`)(?!`)/,cr=/(?:{{[^}]+\?*}})/,ur=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,dr=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,pr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,fr=/(?:\[=[^=]+=\])/,hr=/(?:\[\^[^^]+\^\])/;function mr(e){const t=e.slice(2,-2).trim(),[n,r,i]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[o,s,a]=t.startsWith("/")?["element-attr",null,n]:i?["attr-value",`${n}/${r}`,i]:r?["element-attr",n,r]:["element",null,n];return ye`<code + `}function nr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${Qn(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Kn.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var rr=Object.freeze({__proto__:null,name:Vn,renderInlineCitation:er,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||ye`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(ye`<h1>${Zn.references}</h1>`),r.classList.add("appendix"),n.length){const e=Xn(n,Zn.norm_references);r.appendChild(e)}if(t.length){const e=Xn(t,Zn.info_references);r.appendChild(e)}document.body.appendChild(r)}});const or="core/inlines",sr={},ir=e=>new RegExp(e.map((e=>e.source)).join("|")),ar=Pe({en:{rfc2119Keywords:()=>ir([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY?\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>ir([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),lr=/(?:`[^`]+`)(?!`)/,cr=/(?:{{[^}]+\?*}})/,ur=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,dr=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,pr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,fr=/(?:\[=[^=]+=\])/,hr=/(?:\[\^[^^]+\^\])/;function mr(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[s,i,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return ye`<code ><a - data-xref-type="${o}" - data-xref-for="${s}" - data-link-type="${o}" - data-link-for="${s}" + data-xref-type="${s}" + data-xref-for="${i}" + data-link-type="${s}" + data-link-for="${i}" >${a}</a ></code - >`}function gr(e){const t=ze(e),n=ye`<em class="rfc2119">${t}</em>`;return or[t]=!0,n}function br(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?ye`<a href="${t}" data-matched-text="${e}"></a>`:ye`<a data-cite="${t}" data-matched-text="${e}"></a>`}function wr(e,t){const n=ze(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=In(n);return!!t.parentElement.closest("dfn")?$r(`\`${r.textContent}\``):r}function yr(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[i,o]=r.split("|").map(ze),{type:s,illegal:a}=Be(i,t.parentElement),l=er(i,o),c=i.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;Xe("Normative references in informative sections are not allowed. ",ir,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==s||a?n.normativeReferences.add(c):n.informativeReferences.add(c),l.childNodes[1]?l.childNodes:[l]}function vr(e,t,n){return"ABBR"===t.parentElement.tagName?e:ye`<abbr title="${n.get(e)}">${e}</abbr>`}function xr(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return ye`<var data-type="${r}">${n}</var>`}function kr(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(ze).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const i=n.substring(0,r),o=n.substring(r+1,n.length);return[t(i),t(o)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[i,o]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],s=_r(o),a=n?ze(n):null;return ye`<a + >`}function gr(e){const t=je(e),n=ye`<em class="rfc2119">${t}</em>`;return sr[t]=!0,n}function br(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?ye`<a href="${t}" data-matched-text="${e}"></a>`:ye`<a data-cite="${t}" data-matched-text="${e}"></a>`}function wr(e,t){const n=je(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Pn(n);return!!t.parentElement.closest("dfn")?$r(`\`${r.textContent}\``):r}function yr(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(je),{type:i,illegal:a}=Be(o,t.parentElement),l=er(o,s),c=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;Xe("Normative references in informative sections are not allowed. ",or,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==i||a?n.normativeReferences.add(c):n.informativeReferences.add(c),l.childNodes[1]?l.childNodes:[l]}function vr(e,t,n){return"ABBR"===t.parentElement.tagName?e:ye`<abbr title="${n.get(e)}">${e}</abbr>`}function xr(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return ye`<var data-type="${r}">${n}</var>`}function kr(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(je).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),s=n.substring(r+1,n.length);return[t(o),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,s]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=_r(s),a=n?je(n):null;return ye`<a data-link-type="dfn" data-link-for="${a}" data-xref-for="${a}" - data-lt="${i}" - >${s}</a - >`}function $r(e){const t=e.slice(1,-1);return ye`<code>${t}</code>`}function _r(e){return lr.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?$r(e):_r(e))):document.createTextNode(e)}var Sr=Object.freeze({__proto__:null,name:ir,rfc2119Usage:or,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new He,e.informativeReferences=new He,e.respecRFC2119||(e.respecRFC2119=or);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=ze(e),i=ze(r);t.set(n,i)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,i=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),o=[];let s;for(;s=i.nextNode();)o.push(s);return o}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),o=ar.rfc2119Keywords(),s=new RegExp(`(${sr([o,cr,ur,dr,pr,fr,lr,hr,...r?[r]:[]]).source})`);for(const n of i){const r=n.data.split(s);if(1===r.length)continue;const i=document.createDocumentFragment();let a=!0;for(const s of r)if(a=!a,a)switch(!0){case s.startsWith("{{"):i.append(wr(s,n));break;case s.startsWith("[[["):i.append(br(s));break;case s.startsWith("[["):i.append(...yr(s,n,e));break;case s.startsWith("|"):i.append(xr(s));break;case s.startsWith("[="):i.append(kr(s));break;case s.startsWith("`"):i.append($r(s));break;case s.startsWith("[^"):i.append(mr(s));break;case t.has(s):i.append(vr(s,n,t));break;case o.test(s):i.append(gr(s))}else i.append(s);n.replaceWith(i)}}});function Er(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(i){Je(`Invalid ${t} name "${e}": ${i.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Cr(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Je(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Lr=new Ke;function Ar(e,t){for(const n of t)Lr.has(n)||Lr.set(n,new Set),Lr.get(n).add(e)}const Tr="core/dfn",Rr=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Cr}],["element",{requiresFor:!1,validator:Er}],["element-attr",{requiresFor:!1,validator:Er}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Cr}],["event",{requiresFor:!1,validator:Cr}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new ke(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(i){return Je(`Invalid ${t} "${e}": ${i.message}.`,r,{hint:"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:Cr}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Cr(e.slice(1,-1),t,n,r):(Je(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Nr=[...Rr.keys()];function jr(e,t){let n="";switch(!0){case Nr.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Rr.has(e))),function(e,t,n){const r=Rr.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=nt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:i}=r,o=nt`Use a ${"[data-dfn-for]"} attribute to associate this with ${i}.`;Je(e,Tr,{hint:o,elements:[n]})}r.validator&&r.validator(e,t,n,Tr)}(t,n,e);break;case vn.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=nt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Je(`Internal slot "${e}" must be associated with a WebIDL interface.`,Tr,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const i=["attribute","method"],{dfnType:o}=t.dataset;if(!i.includes(o)||r!==o){const n=nt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,o=`The only allowed types are: ${et(i,{quotes:!0})}. The slot "${e}" seems to be a "${Ye(r)}"?`;return Je(n,Tr,{hint:o,elements:[t]}),"dfn"}return o}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){n=e.closest("[data-dfn-type]")?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function zr(e){switch(!0){case e.matches(".export.no-export"):Je(nt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Tr,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Je(nt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Tr,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}function Ir(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}var Pr=Object.freeze({__proto__:null,name:Tr,run:function(){for(const e of document.querySelectorAll("dfn")){const t=qe(e);if(Ar(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;jr(e,n),zr(e),1===t.length&&n===ze(e.textContent)||(e.dataset.lt=t.join("|"))}i("plugins-done",Ir)}});var Or=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=ze(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set;return document.querySelectorAll("dfn:not([data-lt-noDefault])").forEach((e=>{const n=ze(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=ze(n).toLowerCase(),i=$e.isSingular(r)?$e.plural(r):$e.singular(r);return e.has(i)&&!t.has(i)?i:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),Ar(e,n)}}))}});var Dr=String.raw`span.example-title{text-transform:none} + data-lt="${o}" + >${i}</a + >`}function $r(e){const t=e.slice(1,-1);return ye`<code>${t}</code>`}function _r(e){return lr.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?$r(e):_r(e))):document.createTextNode(e)}var Sr=Object.freeze({__proto__:null,name:or,rfc2119Usage:sr,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new He,e.informativeReferences=new He,e.respecRFC2119||(e.respecRFC2119=sr);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=je(e),o=je(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),s=[];let i;for(;i=o.nextNode();)s.push(i);return s}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),s=ar.rfc2119Keywords(),i=new RegExp(`(${ir([s,cr,ur,dr,pr,fr,lr,hr,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(i);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):o.append(wr(i,n));break;case i.startsWith("[[["):o.append(br(i));break;case i.startsWith("[["):o.append(...yr(i,n,e));break;case i.startsWith("|"):o.append(xr(i));break;case i.startsWith("[="):o.append(kr(i));break;case i.startsWith("`"):o.append($r(i));break;case i.startsWith("[^"):o.append(mr(i));break;case t.has(i):o.append(vr(i,n,t));break;case s.test(i):o.append(gr(i))}else o.append(i);n.replaceWith(o)}}});function Er(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Je(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Cr(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Je(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Lr=new Ke;function Ar(e,t){for(const n of t)Lr.has(n)||Lr.set(n,new Set),Lr.get(n).add(e)}const Tr="core/dfn",Rr=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Cr}],["element",{requiresFor:!1,validator:Er}],["element-attr",{requiresFor:!1,validator:Er}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Cr}],["event",{requiresFor:!1,validator:Cr}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new ke(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Je(`Invalid ${t} "${e}": ${o.message}.`,r,{hint:"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:Cr}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Cr(e.slice(1,-1),t,n,r):(Je(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Nr=[...Rr.keys()];function zr(e,t){let n="";switch(!0){case Nr.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Rr.has(e))),function(e,t,n){const r=Rr.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=nt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=nt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Je(e,Tr,{hint:s,elements:[n]})}r.validator&&r.validator(e,t,n,Tr)}(t,n,e);break;case vn.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=nt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Je(`Internal slot "${e}" must be associated with a WebIDL interface.`,Tr,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const o=["attribute","method"],{dfnType:s}=t.dataset;if(!o.includes(s)||r!==s){const n=nt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${et(o,{quotes:!0})}. The slot "${e}" seems to be a "${Ye(r)}"?`;return Je(n,Tr,{hint:s,elements:[t]}),"dfn"}return s}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){n=e.closest("[data-dfn-type]")?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function jr(e){switch(!0){case e.matches(".export.no-export"):Je(nt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Tr,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Je(nt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Tr,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}function Pr(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}var Ir=Object.freeze({__proto__:null,name:Tr,run:function(){for(const e of document.querySelectorAll("dfn")){const t=qe(e);if(Ar(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;zr(e,n),jr(e),1===t.length&&n===je(e.textContent)||(e.dataset.lt=t.join("|"))}o("plugins-done",Pr)}});var Or=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=je(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set;return document.querySelectorAll("dfn:not([data-lt-noDefault])").forEach((e=>{const n=je(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=je(n).toLowerCase(),o=$e.isSingular(r)?$e.plural(r):$e.singular(r);return e.has(o)&&!t.has(o)?o:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),Ar(e,n)}}))}});var Dr=String.raw`span.example-title{text-transform:none} :is(aside,div).example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both} div.illegal-example{color:red} div.illegal-example p{color:#000} :is(aside,div).example{border-left-width:.5em;border-left-style:solid;border-color:#e0cb52;background:#fcfaee} aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff} -.example pre{background-color:rgba(0,0,0,.03)}`;const qr=Ie({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function Mr(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",i=n.title?ye`<span class="example-title">: ${n.title}</span>`:"";return ye`<div class="marker"> +.example pre{background-color:rgba(0,0,0,.03)}`;const qr=Pe({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function Mr(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?ye`<span class="example-title">: ${n.title}</span>`:"";return ye`<div class="marker"> <a class="self-link">${qr.example}<bdi>${r}</bdi></a - >${i} + >${o} </div>`}var Br=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;document.head.insertBefore(ye`<style> ${Dr} - </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:i}=e;if("aside"===e.localName){++t;const n=Mr(e,t,r);e.prepend(n);const o=De(e,"example",i||String(t));n.querySelector("a.self-link").href=`#${o}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const o=e.id?e.id:null;o&&e.removeAttribute("id");const s=Mr(e,n?0:t,r),a=ye`<div class="example" id="${o}"> - ${s} ${e.cloneNode(!0)} - </div>`;De(a,"example",i||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var Fr=String.raw`.issue-label{text-transform:initial} + </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=Mr(e,t,r);e.prepend(n);const s=De(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${s}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const i=Mr(e,n?0:t,r),a=ye`<div class="example" id="${s}"> + ${i} ${e.cloneNode(!0)} + </div>`;De(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var Fr=String.raw`.issue-label{text-transform:initial} .warning>p:first-child{margin-top:0} .warning{padding:.5em;border-left-width:.5em;border-left-style:solid} span.warning{padding:.1em .5em .15em} @@ -254,29 +254,29 @@ span.warning{padding:.1em .5em .15em} .warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em} li.task-list-item{list-style:none} input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} -.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const Wr="core/issues-notes",Ur=Ie({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"}});function Hr(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),i=document.createElement("ul");e.forEach((e=>{const{type:o,displayType:s,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),i=e.classList.contains("atrisk"),o=t?"issue":n?"warning":r?"ednote":"note",s=t?i?Ur.feature_at_risk:Ur.issue:n?Ur.warning:r?Ur.editors_note:Ur.note;return{type:o,displayType:s,isFeatureAtRisk:i}}(e),l="issue"===o,c="span"===e.localName,{number:u}=e.dataset,d={type:o,inline:c,title:e.title,number:r(e)};if(!c){const r=ye`<div class="${a?`${o} atrisk`:o}" role="${"note"===o?"note":null}"></div>`,c=document.createElement("span"),p=ye`<div role="heading" class="${`${o}-title marker`}">${c}</div>`;De(p,"h",o);let f,h=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):De(r,"issue-container",d.number?`number-${d.number}`:""),l){if(void 0!==d.number&&(h+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return ye`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return ye`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(c.before(e),e.append(c)),c.classList.add("issue-number"),f=t.get(u),!f){Xe(`Failed to fetch issue number ${u}.`,Wr)}f&&!d.title&&(d.title=f.title)}i.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,i=t.title?ye`<span style="text-transform: none">: ${t.title}</span>`:"";return ye`<li><a href="${`#${n}`}">${r}</a>${i}</li>`}(Ur.issue,d,r.id))}if(c.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},i=f?f.labels:[];f&&"CLOSED"===f.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,i=new URL("./issues/",t);i.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const o=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[i,o,s]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*i+.7152*o+.0722*s>.179?"#000":"#fff"}(n),s=`GitHub label: ${r}`;return ye` <a +.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const Wr="core/issues-notes",Ur=Pe({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"}});function Hr(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),o=document.createElement("ul");e.forEach((e=>{const{type:s,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",i=t?o?Ur.feature_at_risk:Ur.issue:n?Ur.warning:r?Ur.editors_note:Ur.note;return{type:s,displayType:i,isFeatureAtRisk:o}}(e),l="issue"===s,c="span"===e.localName,{number:u}=e.dataset,d={type:s,inline:c,title:e.title,number:r(e)};if(!c){const r=ye`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,c=document.createElement("span"),p=ye`<div role="heading" class="${`${s}-title marker`}">${c}</div>`;De(p,"h",s);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):De(r,"issue-container",d.number?`number-${d.number}`:""),l){if(void 0!==d.number&&(h+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return ye`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return ye`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(c.before(e),e.append(c)),c.classList.add("issue-number"),f=t.get(u),!f){Xe(`Failed to fetch issue number ${u}.`,Wr)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?ye`<span style="text-transform: none">: ${t.title}</span>`:"";return ye`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Ur.issue,d,r.id))}if(c.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=f?f.labels:[];f&&"CLOSED"===f.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const s=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,s,i]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*o+.7152*s+.0722*i>.179?"#000":"#fff"}(n),i=`GitHub label: ${r}`;return ye` <a class="respec-gh-label" - style="${`background-color: #${n}; color: ${o}`}" - href="${i.href}" - aria-label="${s}" + style="${`background-color: #${n}; color: ${s}`}" + href="${o.href}" + aria-label="${i}" >${r}</a - >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return ye`<span class="issue-label">: ${t}${r}</span>`}(i,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(o),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=We(p,"section").length+2;p.setAttribute("aria-level",g)}})),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(ye`<p>${Ur.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${Ur.issue_summary}</h1>`)}(i)}var Gr=Object.freeze({__proto__:null,name:Wr,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter((e=>e instanceof HTMLElement));if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map((e=>Number.parseInt(e.dataset.number,10))).filter((e=>e));if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return Je(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Wr),new Map;const i=await r.json();return new Map(Object.entries(i))}(e.github),{head:i}=document;i.insertBefore(ye`<style> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return ye`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=We(p,"section").length+2;p.setAttribute("aria-level",g)}})),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(ye`<p>${Ur.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${Ur.issue_summary}</h1>`)}(o)}var Gr=Object.freeze({__proto__:null,name:Wr,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter((e=>e instanceof HTMLElement));if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map((e=>Number.parseInt(e.dataset.number,10))).filter((e=>e));if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return Je(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Wr),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(ye`<style> ${Fr} - </style>`,i.querySelector("link")),Hr(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Vr="core/best-practices",Zr={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Kr=Ie(Zr),Qr=l in Zr?l:"en";var Jr=Object.freeze({__proto__:null,name:Vr,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=De(e,"bp"),i=ye`<a class="marker self-link" href="${`#${r}`}" + </style>`,o.querySelector("link")),Hr(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Vr="core/best-practices",Zr={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Kr=Pe(Zr),Qr=l in Zr?l:"en";var Jr=Object.freeze({__proto__:null,name:Vr,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=De(e,"bp"),o=ye`<a class="marker self-link" href="${`#${r}`}" ><bdi lang="${Qr}">${Kr.best_practice}${t+1}</bdi></a - >`;if(n){const t=ye`<li>${i}: ${Ge(e)}</li>`;n.appendChild(t)}const o=e.closest("div");if(!o)return void e.classList.add("advisement");o.classList.add("advisement");const s=ye`${i.cloneNode(!0)}: ${e}`;o.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(ye`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Xe("Using best practices summary (#bp-summary) but no best practices found.",Vr),t.remove()}}});const Xr="core/figures",Yr=Ie({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var ei=Object.freeze({__proto__:null,name:Xr,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;De(e,"fig",r),Fe(t,ye`<span class="fig-title"></span>`),t.prepend(ye`<a class="self-link" href="#${e.id}" + >`;if(n){const t=ye`<li>${o}: ${Ge(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=ye`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(ye`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Xe("Using best practices summary (#bp-summary) but no best practices found.",Vr),t.remove()}}});const Xr="core/figures",Yr=Pe({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var eo=Object.freeze({__proto__:null,name:Xr,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;De(e,"fig",r),Fe(t,ye`<span class="fig-title"></span>`),t.prepend(ye`<a class="self-link" href="#${e.id}" >${Yr.fig}<bdi class="figno">${n+1}</bdi></a >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Me(e,"span").removeAttribute("href")})),ye`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> </li>`}(t.id,r));else{Xe("Found a `<figure>` without a `<figcaption>`.",Xr,{elements:[t]})}})),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(ye`<h1>${Yr.list_of_figures}</h1>`,ye`<ul class="tof"> ${e} - </ul>`))}});const ti="core/data-cite",ni="__SPEC__";async function ri(e){const{key:t,frag:n,path:r,href:i}=e;let o="",s="";if(t===ni)o=document.location.href;else{const e=await Hn(t);if(!e)return null;o=e.href,s=e.title}if(i)o=i;else{if(r){const e=r.startsWith("/")?`.${r}`:r;o=new URL(e,o).href}n&&(o=new URL(n,o).href)}return{href:o,title:s}}function ii(e,t,n){const{href:r,title:i}=t,o=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=i),t.href=r,o){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?Fe(e,t):(t.textContent=i,e.append(t)),o){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Je("Exporting an linked external definition is not allowed.",ti,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function oi(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const si=oi("#"),ai=oi("/");function li(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:i,citeHref:o}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:i,isNormative:o}=r?li(r):{key:ni,isNormative:!1};return t.cite=o?i:`?${i}`,t.citeFrag=n.replace("#",""),li(e)}const s=r?`#${r}`:si(n),a=i||ai(n).split("#")[0],{type:l}=Be(n,e),c="normative"===l,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:c,frag:s,path:a,href:o}}function ci(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var ui=Object.freeze({__proto__:null,THIS_SPEC:ni,name:ti,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(li).map((async e=>({entry:e,result:await Hn(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Un(n);r&&Object.assign(qn,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=li(t),r=await ri(n);if(r)ii(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Xe(n,ti,{elements:[t]})}}i("beforesave",ci)},toCiteDetails:li});const di="core/link-to-dfn",pi=[],fi=Ie({en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}});function hi(e){const t=new Map,n=[];for(const r of Lr.get(e)){const{dfnType:i="dfn"}=r.dataset,o=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const s of o){if(t.has(s)&&t.get(s).has(i)){const e=t.get(s).get(i),o="dfn"===e.localName,a="dfn"===r.localName,l=i===(e.dataset.dfnType||"dfn"),c=!s&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(s);if(o&&a&&l&&c){n.push(r);continue}}t.has(s)||t.set(s,new Map),t.get(s).set(i,r),("idl"in r.dataset||"dfn"!==i)&&t.get(s).set("idl",r),De(r,"dfn",e)}}return{result:t,duplicates:n}}function mi(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return qe(e).reduce(((e,r)=>{const i=r.split(".");return 2===i.length&&e.push({for:i[0],title:i[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[])}(e).find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!n)return;const r=t.get(n.title).get(n.for),{linkType:i}=e.dataset;if(i)return r.get(i)||r.get("dfn");{const e=n.for?"idl":"dfn";return r.get(e)||r.get("idl")}}function gi(e,t,n){let r=!1;const{linkFor:i}=e.dataset,{dfnFor:o}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(i&&!n.get(i)&&o&&!o.split(",").map((e=>e.trim())).includes(i))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),i=bi(e)&&bi(t,n);r&&!i||Fe(e,document.createElement("code"))}(e,t),!r}function bi(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function wi(e){e.forEach((e=>{Xe(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,di,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var yi=Object.freeze({__proto__:null,name:di,possibleExternalLinks:pi,run:async function(e){const t=function(){const e=new Ke;for(const t of Lr.keys()){const{result:n,duplicates:r}=hi(t);e.set(t,n),r.length>0&&Je(fi.duplicateMsg(t),di,{title:fi.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){pi.push(e);continue}const r=mi(e,t);if(r){gi(e,r,t)||pi.push(e)}else""===e.dataset.cite?n.push(e):pi.push(e)}wi(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:i}=li(t);r!==ni&&(i||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||wi(pi)}});const vi="core/contrib";var xi=Object.freeze({__proto__:null,name:vi,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Je(nt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,vi)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await i();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void ye(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=je(r)}(r,n):n.textContent="Failed to fetch contributors.";async function i(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let i,o;if("caches"in window)try{if(i=await caches.open(r.origin),o=await i.match(n),o&&new Date(o.headers.get("Expires"))>new Date)return o}catch(e){console.error("Failed to use Cache API.",e)}const s=await fetch(n);if(!s.ok&&o)return console.warn(`Returning a stale cached response for ${r}`),o;if(i&&s.ok){const e=s.clone(),r=new Headers(s.headers),o=new Date(Date.now()+t);r.set("Expires",o.toISOString());const a=new Response(await e.blob(),{headers:r});await i.put(n,a).catch(console.error)}return s}(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return Je("Error loading contributors from GitHub.",vi),console.error(e),null}}}(t,n)}});var ki=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Me(e,`h${t}`)}))}});const $i=["h2","h3","h4","h5","h6"],_i="core/structure",Si=Ie({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Ei(e,t,{prefix:n=""}={}){let r=!1,i=0,o=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=ye`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(i=o,r=!0);let e=a.isIntro?"":r?Ci(o-i+1):n+o;const l=e.split(".").length;if(1===l&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(o+=1,a.header.prepend(ye`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Ai(a.header,n),i=Ei(a.subsections,t,{prefix:e});i&&r.append(i),s.append(r)}}return s}function Ci(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Li(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!$i.includes(r.localName))continue;const i=r.textContent;De(e,null,i),n.push({element:e,header:r,title:i,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Li(e)})}return n}function Ai(e,t){const n=ye`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Me(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Me(e,"span").removeAttribute("id")})),ye`<li class="tocline">${n}</li>`}var Ti=Object.freeze({__proto__:null,name:_i,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(We(e,"section").length+1,6)}`;e.localName!==t&&Me(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){Je("`data-max-toc` must have a value between 0-6 (inclusive).",_i,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Ei(Li(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=ye`<nav id="toc"></nav>`,n=ye`<h2 class="introductory">${Si.toc}</h2>`;De(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const i=ye`<p role="navigation" id="back-to-top"> + </ul>`))}});const to="core/data-cite",no="__SPEC__";async function ro(e){const{key:t,frag:n,path:r,href:o}=e;let s="",i="";if(t===no)s=document.location.href;else{const e=await Hn(t);if(!e)return null;s=e.href,i=e.title}if(o)s=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:i}}function oo(e,t,n){const{href:r,title:o}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,s){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?Fe(e,t):(t.textContent=o,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Je("Exporting an linked external definition is not allowed.",to,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function so(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const io=so("#"),ao=so("/");function lo(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:s}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:s}=r?lo(r):{key:no,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=n.replace("#",""),lo(e)}const i=r?`#${r}`:io(n),a=o||ao(n).split("#")[0],{type:l}=Be(n,e),c="normative"===l,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:c,frag:i,path:a,href:s}}function co(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var uo=Object.freeze({__proto__:null,THIS_SPEC:no,name:to,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(lo).map((async e=>({entry:e,result:await Hn(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Un(n);r&&Object.assign(qn,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=lo(t),r=await ro(n);if(r)oo(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Xe(n,to,{elements:[t]})}}o("beforesave",co)},toCiteDetails:lo});const po="core/link-to-dfn",fo=[],ho=Pe({en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}});function mo(e){const t=new Map,n=[];for(const r of Lr.get(e)){const{dfnType:o="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of s){if(t.has(i)&&t.get(i).has(o)){const e=t.get(i).get(o),s="dfn"===e.localName,a="dfn"===r.localName,l=o===(e.dataset.dfnType||"dfn"),c=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(s&&a&&l&&c){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(i).set("idl",r),De(r,"dfn",e)}}return{result:t,duplicates:n}}function go(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return qe(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[])}(e).find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!n)return;const r=t.get(n.title).get(n.for),{linkType:o}=e.dataset;if(o)return r.get(o)||r.get("dfn");{const e=n.for?"idl":"dfn";return r.get(e)||r.get("idl")}}function bo(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&s&&!s.split(",").map((e=>e.trim())).includes(o))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),o=wo(e)&&wo(t,n);r&&!o||Fe(e,document.createElement("code"))}(e,t),!r}function wo(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function yo(e){e.forEach((e=>{Xe(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,po,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var vo=Object.freeze({__proto__:null,name:po,possibleExternalLinks:fo,run:async function(e){const t=function(){const e=new Ke;for(const t of Lr.keys()){const{result:n,duplicates:r}=mo(t);e.set(t,n),r.length>0&&Je(ho.duplicateMsg(t),po,{title:ho.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){fo.push(e);continue}const r=go(e,t);if(r){bo(e,r,t)||fo.push(e)}else""===e.dataset.cite?n.push(e):fo.push(e)}yo(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:o}=lo(t);r!==no&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||yo(fo)}});const xo="core/contrib";var ko=Object.freeze({__proto__:null,name:xo,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Je(nt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,xo)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await o();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void ye(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=ze(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,s;if("caches"in window)try{if(o=await caches.open(r.origin),s=await o.match(n),s&&new Date(s.headers.get("Expires"))>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(o&&i.ok){const e=i.clone(),r=new Headers(i.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return i}(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return Je("Error loading contributors from GitHub.",xo),console.error(e),null}}}(t,n)}});var $o=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Me(e,`h${t}`)}))}});const _o=["h2","h3","h4","h5","h6"],So="core/structure",Eo=Pe({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Co(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=ye`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?Lo(s-o+1):n+s;const l=e.split(".").length;if(1===l&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(ye`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=To(a.header,n),o=Co(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function Lo(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Ao(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!_o.includes(r.localName))continue;const o=r.textContent;De(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Ao(e)})}return n}function To(e,t){const n=ye`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Me(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Me(e,"span").removeAttribute("id")})),ye`<li class="tocline">${n}</li>`}var Ro=Object.freeze({__proto__:null,name:So,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(We(e,"section").length+1,6)}`;e.localName!==t&&Me(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){Je("`data-max-toc` must have a value between 0-6 (inclusive).",So,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Co(Ao(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=ye`<nav id="toc"></nav>`,n=ye`<h2 class="introductory">${Eo.toc}</h2>`;De(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const o=ye`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> - </p>`;document.body.append(i)}(t)}r("toc")}});const Ri=Ie({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"}});var Ni=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(ye`<p><em>${Ri.informative}</em></p>`)}))}});const ji=Ie({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${ze(t.textContent)}`),n}}});var zi=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(De(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=ji.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),i=ye`<div class="header-wrapper"></div>`;n.replaceWith(i);const o=ye`<a + </p>`;document.body.append(o)}(t)}r("toc")}});const No=Pe({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"}});var zo=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(ye`<p><em>${No.informative}</em></p>`)}))}});const jo=Pe({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${je(t.textContent)}`),n}}});var Po=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(De(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=jo.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=ye`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=ye`<a href="#${t}" class="self-link" aria-label="${r}" - ></a>`;i.append(n,o)}}});var Ii=Object.freeze({__proto__:null,name:"geonovum/conformance",run:function(){const e=document.querySelector("section#conformance");e&&function(e){const t=ye` + ></a>`;o.append(n,s)}}});var Io=Object.freeze({__proto__:null,name:"geonovum/conformance",run:function(){const e=document.querySelector("section#conformance");e&&function(e){const t=ye` <h2>Conformiteit</h2> <p> Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle @@ -284,20 +284,20 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} is alles in dit document normatief. </p> <p>Informatief en normatief.</p> - `;e.prepend(...t.childNodes)}(e)}});const Pi="ui/save-html",Oi=Ie({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Di=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return it(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return it(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function qi(e,t){const{id:n,href:r,ext:i,title:o,type:s}=e,a=function(e,t=""){return Ce.format(e).replace(Ee,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return ye`<a + `;e.prepend(...t.childNodes)}(e)}});const Oo="ui/save-html",Do=Pe({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),qo=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return ot(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return ot(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function Mo(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return Ce.format(e).replace(Ee,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return ye`<a href="${r}" id="${n}" - download="${l}.${i}" - type="${s}" + download="${l}.${o}" + type="${i}" class="respec-save-button" - onclick=${()=>It.closeModal()} - >${o}</a - >`}var Mi=Object.freeze({__proto__:null,exportDocument:function(e,t){return Xe("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Pi,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),it(t)},name:Pi,run:function(e){const t={async show(t){await document.respec.ready;const n=ye`<div class="respec-save-buttons"> - ${Di.map((t=>qi(t,e)))} - </div>`;It.freshModal(Oi.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=It.addCommand(Oi.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Bi="https://respec.org/specref/",Fi=Ie({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),Wi=It.addCommand(Fi.search_specref,(function(){const e=ye` - <iframe class="respec-iframe" src="${Bi}" onload=${e=>e.target.classList.add("ready")}></iframe> - <a href="${Bi}" target="_blank">Open Search UI in a new tab</a> - `;It.freshModal(Fi.search_specref,e,Wi)}),"Ctrl+Shift+Alt+space","🔎");var Ui=Object.freeze({__proto__:null});const Hi=Ie({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const Gi=document.createElement("div"),Vi=ye.bind(Gi),Zi=It.addCommand(`${Hi.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(Ki).forEach((t=>{e.push(t)}));Vi` + onclick=${()=>Pt.closeModal()} + >${s}</a + >`}var Bo=Object.freeze({__proto__:null,exportDocument:function(e,t){return Xe("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Oo,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),ot(t)},name:Oo,run:function(e){const t={async show(t){await document.respec.ready;const n=ye`<div class="respec-save-buttons"> + ${qo.map((t=>Mo(t,e)))} + </div>`;Pt.freshModal(Do.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=Pt.addCommand(Do.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Fo="https://respec.org/specref/",Wo=Pe({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),Uo=Pt.addCommand(Wo.search_specref,(function(){const e=ye` + <iframe class="respec-iframe" src="${Fo}" onload=${e=>e.target.classList.add("ready")}></iframe> + <a href="${Fo}" target="_blank">Open Search UI in a new tab</a> + `;Pt.freshModal(Wo.search_specref,e,Uo)}),"Ctrl+Shift+Alt+space","🔎");var Ho=Object.freeze({__proto__:null});const Go=Pe({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const Vo=document.createElement("div"),Zo=ye.bind(Vo),Ko=Pt.addCommand(`${Go.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(Qo).forEach((t=>{e.push(t)}));Zo` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -321,12 +321,12 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} </thead> <tbody>${e}</tbody> </table> -`,It.freshModal(`${Hi.about_respec} - ${window.respecVersion}`,Gi,Zi)}),"Ctrl+Shift+Alt+A","ℹ️");function Ki({name:e,duration:t}){return ye` +`,Pt.freshModal(`${Go.about_respec} - ${window.respecVersion}`,Vo,Ko)}),"Ctrl+Shift+Alt+A","ℹ️");function Qo({name:e,duration:t}){return ye` <tr> <td><a href="${`https://github.com/w3c/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}var Qi=Object.freeze({__proto__:null});var Ji=Object.freeze({__proto__:null,name:"core/seo",run:function(){const e=document.querySelector("#abstract p:first-of-type");if(!e)return;const t=e.textContent.replace(/\s+/," ").trim(),n=document.createElement("meta");n.name="description",n.content=t,document.head.appendChild(n)}});var Xi=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa} + `}var Jo=Object.freeze({__proto__:null});var Xo=Object.freeze({__proto__:null,name:"core/seo",run:function(){const e=document.querySelector("#abstract p:first-of-type");if(!e)return;const t=e.textContent.replace(/\s+/," ").trim(),n=document.createElement("meta");n.name="description",n.content=t,document.head.appendChild(n)}});var Yo=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa} .hljs-comment,.hljs-quote{color:#717277;font-style:italic} .hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4} .hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#ca4706;font-weight:700} @@ -337,21 +337,21 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} .hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3} .hljs-emphasis{font-style:italic} .hljs-strong{font-weight:700} -.hljs-link{text-decoration:underline}`;async function Yi(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-geonovum.js",document.baseURI).href));return await t.text()}const eo=Le({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(eo);const to=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return ss}))).default}catch{return Yi("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",to.then((e=>({worker:e}))));const no=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function ro(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter((e=>"highlight"!==e&&"nolinks"!==e)).map((e=>e.toLowerCase())));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:no(),languages:t},r=await to;return r.postMessage(n),new Promise(((e,t)=>{const i=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(o){const{data:{id:s,language:a,value:l}}=o;s===n.id&&(r.removeEventListener("message",t),clearTimeout(i),e({language:a,value:l}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:i,value:o}=r;switch(e.localName){case"pre":e.classList.remove(i),e.innerHTML=`<code class="hljs${i?` ${i}`:""}">${o}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=o,e.classList.add("hljs"),i&&e.classList.add(i)}e.setAttribute("aria-busy","false")}var io=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n ")].filter((e=>"pre"!==e.localName||!e.querySelector("code")));if(!t.length)return;const n=t.filter((e=>e.textContent.trim())).map(ro);document.head.appendChild(ye`<style> - ${Xi} - </style>`),await Promise.all(n)}});const oo=Ie({en:{missing_test_suite_uri:nt`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:nt`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:nt`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:nt`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),so="core/data-tests";function ao(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[i]=r;if(r.find((e=>"https"===e))){const e=document.createElement("span");e.textContent="🔒",e.setAttribute("aria-label","requires a secure connection"),e.setAttribute("title","Test requires HTTPS"),i=i.replace(".https",""),t.push(e)}if(i.split(".").join("-").split("-").find((e=>"manual"===e))){const e=document.createElement("span");e.textContent="💪",e.setAttribute("aria-label","the test must be run manually"),e.setAttribute("title","Manual test"),i=i.replace("-manual",""),t.push(e)}return ye` +.hljs-link{text-decoration:underline}`;async function es(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-geonovum.js",document.baseURI).href));return await t.text()}const ts=Le({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(ts);const ns=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return ii}))).default}catch{return es("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",ns.then((e=>({worker:e}))));const rs=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function os(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter((e=>"highlight"!==e&&"nolinks"!==e)).map((e=>e.toLowerCase())));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:rs(),languages:t},r=await ns;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(s){const{data:{id:i,language:a,value:l}}=s;i===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:l}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:s}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${s}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=s,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var ss=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n ")].filter((e=>"pre"!==e.localName||!e.querySelector("code")));if(!t.length)return;const n=t.filter((e=>e.textContent.trim())).map(os);document.head.appendChild(ye`<style> + ${Yo} + </style>`),await Promise.all(n)}});const is=Pe({en:{missing_test_suite_uri:nt`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:nt`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:nt`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:nt`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),as="core/data-tests";function ls(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[o]=r;if(r.find((e=>"https"===e))){const e=document.createElement("span");e.textContent="🔒",e.setAttribute("aria-label","requires a secure connection"),e.setAttribute("title","Test requires HTTPS"),o=o.replace(".https",""),t.push(e)}if(o.split(".").join("-").split("-").find((e=>"manual"===e))){const e=document.createElement("span");e.textContent="💪",e.setAttribute("aria-label","the test must be run manually"),e.setAttribute("title","Manual test"),o=o.replace("-manual",""),t.push(e)}return ye` <li> - <a href="${e}">${i}</a> + <a href="${e}">${o}</a> ${t} </li> - `}function lo(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{Xe(nt`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,so,{elements:[n]})}})).filter((e=>e))}function co(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=nt`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=nt`To fix, remove duplicates from ${"[data-tests]"}: ${function(e,{quotes:t}={quotes:!1}){return je(e,t?e=>Ye(tt(e)):Ye)}(n,{quotes:!0})}.`;Xe(e,so,{hint:r,elements:[t]})}}function uo(e){const t=[...new Set(e)];return ye` + `}function cs(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{Xe(nt`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,as,{elements:[n]})}})).filter((e=>e))}function us(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=nt`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=nt`To fix, remove duplicates from ${"[data-tests]"}: ${function(e,{quotes:t}={quotes:!1}){return ze(e,t?e=>Ye(tt(e)):Ye)}(n,{quotes:!0})}.`;Xe(e,as,{hint:r,elements:[t]})}}function ds(e){const t=[...new Set(e)];return ye` <details class="respec-tests-details removeOnSave"> <summary>tests: ${t.length}</summary> <ul> - ${t.map(ao)} + ${t.map(ls)} </ul> </details> - `}var po=Object.freeze({__proto__:null,name:so,run:function(e){const t=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));if(t.length)if(e.testSuiteURI)for(const n of t){const t=lo(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);co(t,n);const r=uo(t);n.append(r)}else Je(oo.missing_test_suite_uri,so)}});const fo="core/list-sorter";function ho(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function mo(e,t){return[...e.querySelectorAll(":scope > li")].sort(ho(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function go(e,t){return[...e.querySelectorAll(":scope > dt")].sort(ho(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,i=document.createDocumentFragment();let{nextSibling:o}=t;for(;o&&o.nextSibling;){i.appendChild(o.cloneNode(!0));const{nodeType:e,nodeName:t}=o.nextSibling;if(e===n&&t===r)break;o=o.nextSibling}return i.prepend(t.cloneNode(!0)),e.appendChild(i),e}),document.createDocumentFragment())}var bo=Object.freeze({__proto__:null,name:fo,run:function(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=go(t,n);break;case"ol":case"ul":e=mo(t,n);break;default:Xe(`ReSpec can't sort ${t.localName} elements.`,fo,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:go,sortListItems:mo});var wo=String.raw`var:hover{text-decoration:underline;cursor:pointer} + `}var ps=Object.freeze({__proto__:null,name:as,run:function(e){const t=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));if(t.length)if(e.testSuiteURI)for(const n of t){const t=cs(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);us(t,n);const r=ds(t);n.append(r)}else Je(is.missing_test_suite_uri,as)}});const fs="core/list-sorter";function hs(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function ms(e,t){return[...e.querySelectorAll(":scope > li")].sort(hs(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function gs(e,t){return[...e.querySelectorAll(":scope > dt")].sort(hs(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){o.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var bs=Object.freeze({__proto__:null,name:fs,run:function(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=gs(t,n);break;case"ol":case"ul":e=ms(t,n);break;default:Xe(`ReSpec can't sort ${t.localName} elements.`,fs,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:gs,sortListItems:ms});var ws=String.raw`var:hover{text-decoration:underline;cursor:pointer} var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)} var.respec-hl-c1{--bg-color:#f4d200} var.respec-hl-c2{--bg-color:#ff87a2} @@ -362,7 +362,7 @@ var.respec-hl-c6{--bg-color:#82ddff} var.respec-hl-c7{--bg-color:#ffbcf2} @media print{ var.respec-hl{background:0 0;color:#000;box-shadow:unset} -}`;function yo(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=ze(e.textContent),n=e.closest("section"),r=xo(e),i=[...n.querySelectorAll("var")].filter((e=>ze(e.textContent)===t&&e.closest("section")===n)),o=i[0].classList.contains("respec-hl");if(vo.set(r,o),o)return i.forEach((e=>ko(e,r))),[];i.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return i}(t),r=()=>{const e=xo(t);n.forEach((t=>ko(t,e))),[...vo.keys()].forEach((e=>vo.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const vo=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function xo(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===vo.get("respec-hl-c1")?"respec-hl-c1":[...vo.keys()].find((e=>vo.get(e)))||"respec-hl-c1"}function ko(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var $o=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=wo,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",yo))),i("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(ko)}))}});var _o=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var So=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: ")));if(!e.length)return;for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(ye`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=_o,document.head.appendChild(t)}});const Eo="core/anchor-expander";function Co(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching element "${t}", but it has no title or marker.`,Eo,{title:"Missing title.",elements:[n]})}const i=Ge(r);n.append(...i.childNodes),n.classList.add("box-ref")}function Lo(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Eo,{title:"Missing figcaption in referenced figure.",elements:[n]})}const i=[...Ge(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...i),n.classList.add("fig-ref");const o=r.querySelector(".fig-title");!n.hasAttribute("title")&&o&&(n.title=ze(o.textContent))}function Ao(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Eo,{title:"Missing caption in referenced table.",elements:[n]})}const i=[...Ge(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...i),n.classList.add("table-ref");const o=r.querySelector(".table-title");!n.hasAttribute("title")&&o&&(n.title=ze(o.textContent))}function To(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Ro(r,n),No(r,n);else{n.textContent=n.getAttribute("href");Je("Found matching section, but the section was lacking a heading element.",Eo,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Ro(e,t){const n=e.querySelector(".self-link"),r=[...Ge(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Me(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function No(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const i=t.closest(`[${n}]`);i&&i.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var jo=Object.freeze({__proto__:null,name:Eo,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":Ro(n,t);break;case"section":To(n,e,t);break;case"figure":Lo(n,e,t);break;case"table":Ao(n,e,t);break;case"aside":case"div":Co(n,e,t);break;default:t.textContent=t.getAttribute("href");Je("ReSpec doesn't support expanding this kind of reference.",Eo,{title:`Can't expand "#${e}".`,elements:[t]})}No(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Je(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Eo,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var zo=String.raw`dfn{cursor:pointer} +}`;function ys(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=je(e.textContent),n=e.closest("section"),r=xs(e),o=[...n.querySelectorAll("var")].filter((e=>je(e.textContent)===t&&e.closest("section")===n)),s=o[0].classList.contains("respec-hl");if(vs.set(r,s),s)return o.forEach((e=>ks(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=xs(t);n.forEach((t=>ks(t,e))),[...vs.keys()].forEach((e=>vs.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const vs=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function xs(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===vs.get("respec-hl-c1")?"respec-hl-c1":[...vs.keys()].find((e=>vs.get(e)))||"respec-hl-c1"}function ks(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var $s=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=ws,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",ys))),o("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(ks)}))}});var _s=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var Ss=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: ")));if(!e.length)return;for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(ye`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=_s,document.head.appendChild(t)}});const Es="core/anchor-expander";function Cs(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching element "${t}", but it has no title or marker.`,Es,{title:"Missing title.",elements:[n]})}const o=Ge(r);n.append(...o.childNodes),n.classList.add("box-ref")}function Ls(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Es,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ge(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=je(s.textContent))}function As(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Je(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Es,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ge(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=je(s.textContent))}function Ts(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Rs(r,n),Ns(r,n);else{n.textContent=n.getAttribute("href");Je("Found matching section, but the section was lacking a heading element.",Es,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Rs(e,t){const n=e.querySelector(".self-link"),r=[...Ge(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Me(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Ns(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var zs=Object.freeze({__proto__:null,name:Es,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":Rs(n,t);break;case"section":Ts(n,e,t);break;case"figure":Ls(n,e,t);break;case"table":As(n,e,t);break;case"aside":case"div":Cs(n,e,t);break;default:t.textContent=t.getAttribute("href");Je("ReSpec doesn't support expanding this kind of reference.",Es,{title:`Can't expand "#${e}".`,elements:[t]})}Ns(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Je(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Es,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var js=String.raw`dfn{cursor:pointer} .dfn-panel{position:absolute;z-index:35;min-width:300px;max-width:500px;padding:.5em .75em;margin-top:.6em;font-family:"Helvetica Neue",sans-serif;font-size:small;background:#fff;color:#000;box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);border-radius:2px} .dfn-panel:not(.docked)>.caret{position:absolute;top:-9px} .dfn-panel:not(.docked)>.caret::after,.dfn-panel:not(.docked)>.caret::before{content:"";position:absolute;border:10px solid transparent;border-top:0;border-bottom:10px solid #fff;top:0} @@ -379,21 +379,21 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} .dfn-panel a[href]:hover{border-bottom-width:1px} .dfn-panel ul{padding:0} .dfn-panel li{margin-left:1em} -.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Io(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),i=`dfn-panel-for-${e.id}`,o=e.getAttribute("aria-label")||ze(e.textContent),s=ye` +.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Ps(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||je(e.textContent),i=ye` <div class="dfn-panel" - id="${i}" + id="${o}" hidden role="dialog" aria-modal="true" - aria-label="Links in this document to definition: ${o}" + aria-label="Links in this document to definition: ${s}" > <span class="caret"></span> <div> <a class="self-link" href="${n}" - aria-label="Permalink for definition: ${o}. Activate to close this dialog." + aria-label="Permalink for definition: ${s}. Activate to close this dialog." >Permalink</a > ${function(e){return e.matches("dfn[data-export]")?ye`<span @@ -410,13 +410,13 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} <p><b>Referenced in:</b></p> ${function(e,t){if(!t.length)return ye`<ul> <li>Not referenced in this document.</li> - </ul>`;const n=new Map;t.forEach(((t,r)=>{const i=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=i);const o=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`§ ${ze(n.textContent)}`:null}(t);(n.get(o)||n.set(o,[]).get(o)).push(i)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),i=e=>ye`<li> + </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`§ ${je(n.textContent)}`:null}(t);(n.get(s)||n.set(s,[]).get(s)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>ye`<li> ${r(e).map((e=>ye`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} </li>`;return ye`<ul> - ${[...n].map(i)} + ${[...n].map(o)} </ul>`}(t,r)} </div> - `;return s}var Po=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(ye`<style> - ${zo} - </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Io(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return as}))).default}catch{return Yi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Oo="core/linter-rules/check-charset",Do=Ie({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var qo=Object.freeze({__proto__:null,name:Oo,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Xe(Do.msg,Oo,{hint:Do.hint,elements:[...t]})}});const Mo="core/linter-rules/check-punctuation",Bo=[".",":","!","?"],Fo=Ie({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Bo.map((e=>`"${e}"`)).join(", ")}.`}});var Wo=Object.freeze({__proto__:null,name:Mo,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Bo.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Xe(Fo.msg,Mo,{hint:Fo.hint,elements:n})}});const Uo="core/linter-rules/local-refs-exist",Ho=Ie({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Go(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Vo=Object.freeze({__proto__:null,name:Uo,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Go);t.length&&Xe(Ho.msg,Uo,{hint:Ho.hint,elements:t})}});const Zo="core/linter-rules/no-headingless-sections",Ko=Ie({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"}});var Qo=Object.freeze({__proto__:null,name:Zo,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&Xe(Ko.msg,Zo,{hint:Ko.hint,elements:t})}});const Jo="core/linter-rules/no-unused-vars",Xo=Ie({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var Yo=Object.freeze({__proto__:null,name:Jo,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const i=new Map;for(const e of r){const t=ze(e.textContent);(i.get(t)||i.set(t,[]).get(t)).push(e)}for(const e of i.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Xe(Xo.msg,Jo,{hint:Xo.hint,elements:t})}});const es="core/linter-rules/privsec-section",ts=Ie({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var ns=Object.freeze({__proto__:null,name:es,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&Xe(ts.msg,es,{hint:ts.hint})}});const rs="core/linter-rules/no-http-props",is=Ie({en:{msg:nt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:nt`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var os=Object.freeze({__proto__:null,name:rs,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=je(t,(e=>nt`${`[${e}]`}`));Xe(is.msg,rs,{hint:is.hint+e})}}}),ss=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),as=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); + `;return i}var Is=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(ye`<style> + ${js} + </style>`,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Ps(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return ai}))).default}catch{return es("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Os="core/linter-rules/check-charset",Ds=Pe({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var qs=Object.freeze({__proto__:null,name:Os,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Xe(Ds.msg,Os,{hint:Ds.hint,elements:[...t]})}});const Ms="core/linter-rules/check-punctuation",Bs=[".",":","!","?"],Fs=Pe({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Bs.map((e=>`"${e}"`)).join(", ")}.`}});var Ws=Object.freeze({__proto__:null,name:Ms,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Bs.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Xe(Fs.msg,Ms,{hint:Fs.hint,elements:n})}});const Us="core/linter-rules/local-refs-exist",Hs=Pe({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Gs(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Vs=Object.freeze({__proto__:null,name:Us,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Gs);t.length&&Xe(Hs.msg,Us,{hint:Hs.hint,elements:t})}});const Zs="core/linter-rules/no-headingless-sections",Ks=Pe({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"}});var Qs=Object.freeze({__proto__:null,name:Zs,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&Xe(Ks.msg,Zs,{hint:Ks.hint,elements:t})}});const Js="core/linter-rules/no-unused-vars",Xs=Pe({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var Ys=Object.freeze({__proto__:null,name:Js,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=je(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Xe(Xs.msg,Js,{hint:Xs.hint,elements:t})}});const ei="core/linter-rules/privsec-section",ti=Pe({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var ni=Object.freeze({__proto__:null,name:ei,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&Xe(ti.msg,ei,{hint:ti.hint})}});const ri="core/linter-rules/no-http-props",oi=Pe({en:{msg:nt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:nt`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var si=Object.freeze({__proto__:null,name:ri,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=ze(t,(e=>nt`${`[${e}]`}`));Xe(oi.msg,ri,{hint:oi.hint+e})}}}),ii=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),ai=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); //# sourceMappingURL=respec-geonovum.js.map diff --git a/builds/respec-geonovum.js.map b/builds/respec-geonovum.js.map index 86e42c0d0b..56d44a1feb 100644 --- a/builds/respec-geonovum.js.map +++ b/builds/respec-geonovum.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-geonovum.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/reindent.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/geonovum.js","../src/core/location-hash.js","../src/core/defaults.js","../src/geonovum/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/geonovum/style.js","../src/geonovum/l10n.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/data-transform.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/geonovum/conformance.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v4.2.12 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction merge(obj) {\n let i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n}\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = merge({}, block);\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = merge({}, block.normal, {\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n});\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = merge({}, block.normal, {\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = merge({}, inline);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = merge({}, inline.normal, {\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = merge({}, inline.normal, {\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n});\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n});\n\n/**\n * smartypants text replacement\n * @param {string} text\n */\nfunction smartypants(text) {\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n}\n\n/**\n * mangle email addresses\n * @param {string} text\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${level}>\\n`;\n }\n\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `<li>${text}</li>\\n`;\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `<tbody>${body}</tbody>`;\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n function onError(e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n\n try {\n const tokens = Lexer.lex(src, opt);\n if (opt.walkTokens) {\n if (opt.async) {\n return Promise.all(marked.walkTokens(tokens, opt.walkTokens))\n .then(() => {\n return Parser.parse(tokens, opt);\n })\n .catch(onError);\n }\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parse(tokens, opt);\n } catch (e) {\n onError(e);\n }\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n merge(marked.defaults, opt);\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = merge({}, pack);\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = function(src, opt) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked.parseInline(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked.parseInline(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n try {\n const tokens = Lexer.lexInline(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parseInline(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n};\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: #193766;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: white;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/geonovum/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/geonovum/style.js\"),\n import(\"../src/geonovum/l10n.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/geonovum/conformance.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for Geonovum documents\n */\nexport const name = \"geonovum/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"cc-by-nd\",\n {\n name: \"Creative Commons Attribution-NoDerivatives 4.0 International Public License\",\n short: \"CC-BY-ND\",\n url: \"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl\",\n },\n ],\n]);\n\nconst geonovumDefaults = {\n lint: {\n \"privsec-section\": true,\n },\n doJsonLd: true,\n license: \"cc-by\",\n specStatus: \"GN-BASIS\",\n logos: [\n {\n src: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n alt: \"Geonovum\",\n id: \"Geonovum\",\n height: 67,\n width: 132,\n url: \"https://www.geonovum.nl/\",\n },\n ],\n};\n\nfunction computeProps(conf) {\n return {\n isCCBY: conf.license === \"cc-by\",\n licenseInfo: licenses.get(conf.license),\n isBasic: conf.specStatus === \"GN-BASIS\",\n isRegular: conf.specStatus === \"GN-BASIS\",\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...geonovumDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...geonovumDefaults,\n ...conf,\n lint,\n });\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module geonovum/style\n// Inserts a link to the appropriate Geonovum style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"geonovum/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n script.addEventListener(\n \"load\",\n () => {\n if (window.location.hash) {\n window.location.href = window.location.hash;\n }\n },\n { once: true }\n );\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createStyle(css_name) {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = `https://tools.geostandaarden.nl/respec/style/${css_name}.css`;\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C fixup.js\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preconnect\", // for Geonovum styles and scripts.\n href: \"https://tools.geostandaarden.nl/\",\n },\n {\n hint: \"preload\", // all Geonovum specs import base.css.\n href: \"https://tools.geostandaarden.nl/respec/style/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all Geonovum specs show the logo.\n href: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n as: \"image\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// add favicon for Geonovum\nconst favicon = document.createElement(\"link\");\nfavicon.rel = \"shortcut icon\";\nfavicon.type = \"image/x-icon\";\nfavicon.href =\n \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico\";\ndocument.head.prepend(favicon);\n\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\n// export function run(conf, doc, cb) {\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.\";\n conf.specStatus = \"GN-BASIS\";\n showWarning(msg, name);\n }\n\n if (document.body.querySelector(\"figure.scalable\")) {\n // Apply leaflet style if class scalable is present\n document.head.appendChild(createStyle(\"leaflet\"));\n document.head.appendChild(createStyle(\"font-awesome\"));\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"GN-WV\":\n styleFile += \"GN-WV.css\";\n break;\n case \"GN-CV\":\n styleFile += \"GN-CV.css\";\n break;\n case \"GN-VV\":\n styleFile += \"GN-VV.css\";\n break;\n case \"GN-DEF\":\n styleFile += \"GN-DEF.css\";\n break;\n case \"GN-BASIS\":\n styleFile += \"GN-BASIS.css\";\n break;\n default:\n styleFile = \"base.css\";\n }\n\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://tools.geostandaarden.nl/respec/style/${styleFile}`;\n linkCSS(document, finalStyleURL);\n}\n","// @ts-check\n// Module geonovum/l10n\n// Looks at the lang attribute on the root element and uses it to manage the config.l10n object so\n// that other parts of the system can localise their text\nimport { html } from \"../core/import-maps.js\";\nimport { l10n } from \"../core/l10n.js\";\nexport const name = \"geonovum/l10n\";\nconst additions = {\n en: {\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. Other documents may supersede\n this document. A list of current Geonovum publications and the latest\n revision of this document can be found via\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >(in Dutch).`,\n },\n nl: {\n status_at_publication: html`Deze paragraaf beschrijft de status van dit\n document ten tijde van publicatie. Het is mogelijk dat er actuelere\n versies van dit document bestaan. Een lijst van Geonovum publicaties en de\n laatste gepubliceerde versie van dit document zijn te vinden op\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >.`,\n },\n};\n\nObject.keys(additions).forEach(key => {\n if (!l10n[key]) l10n[key] = {};\n Object.assign(l10n[key], additions[key]);\n});\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"참조\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY?\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before {\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n return dfnsByType.get(linkType) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module geonovum/conformance\n// Handle the conformance section properly.\n// based on W3C conformance, but because Geonovum has different requirements, have a separate module\nimport { html } from \"../core/import-maps.js\";\nexport const name = \"geonovum/conformance\";\n\n/**\n * @param {Element} conformance\n */\nfunction processConformance(conformance) {\n const content = html`\n <h2>Conformiteit</h2>\n <p>\n Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle\n diagrammen, voorbeelden, en noten in dit document niet normatief. Verder\n is alles in dit document normatief.\n </p>\n <p>Informatief en normatief.</p>\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run() {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance) {\n processConformance(conformance);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"仕様検索\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"搜索 Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"🔎\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${\"[testSuiteURI]\"} が見つかりません.`,\n tests: \"テスト\",\n test: \"テスト\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`本规范中包含测试,但在 ReSpec 配置中缺少 ${\"[testSuiteURI]\"}。`,\n tests: \"测试\",\n test: \"测试\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"🔒\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"💪\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n showError(l10n.missing_test_suite_uri, name);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","merge","key","i","arguments","length","Object","hasOwnProperty","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","trim","pop","splice","push","invert","l","suffLen","currChar","slice","checkSanitizeDeprecation","console","warn","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","marked","err","pending","setTimeout","onError","message","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","docLang","startsWith","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","Set","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","msg","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","addQuotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$f","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$o","style$1","l10n$m","github$1","dataInclude","markdown","reindent$1","dataTransform","inlines","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","conformance","saveHtml","searchSpecref","aboutRespec","seo","dataTests","listSorter","highlightVars$1","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","geonovumDefaults","doJsonLd","license","logos","alt","height","width","isCCBY","licenseInfo","isBasic","isRegular","computeProps","css$d","noReSpecCSS","createStyle","css_name","resourceHints","createResourceHints","favicon","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","urls","frag","reduce","nextLink","linkCSS","additions","status_at_publication","nl","resolveGithubPromise","rejectGithubPromise","github","file_a_bug","participate","commit_history","ko","zh","ja","es","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","commitHistoryURL","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","shortName","githubAPI","hostname","excludeGithubLinks","otherLink","normalizedGHObj","apiBase","fullName","issuesURL","pullsURL","newIssuesURL","normalizedConfig","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","arg","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","Date","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","headers","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","authors","etAl","publisher","date","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","contains","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","terms","plurals","userDefinedPlurals","uniquePlurals","css$b","makeTitle","num","report","number","div","inAside","exampleTitle","css$9","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","note","handleIssues","ins","ghIssues","getIssueNumber","Number","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","insertAdjacentHTML","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","every","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","editors","editor","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","toISOString","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","processConformance","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","publishDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$7","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","testSuiteURI","handleDuplicates","testURLs","codedJoinAnd","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$5","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,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oB,SAAS,QAAUgF,EAAK5tB,IAAiB,WAARA,IAEpDqG,QAAOrG,GACN,IAAI8hB,IAAI8L,EAAK5tB,GAAM9L,OAAOQ,SAASuK,MAAMA,KAAK2iB,WAAW,aAG7D,GAAI0/B,EAAiBnhD,OAAQ,CAC3B,MAAMoM,EAAO4W,GAAQm+B,GAAkBthD,GAAO0oB,EAAO,GAAG,IAAI1oB,SAC5D8jB,GAAYruB,GAAKuyB,IAAKv0B,GAAM,CAAEyuB,KAAMzsB,GAAKysB,KAAO3V,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file +{"version":3,"file":"respec-geonovum.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/reindent.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/geonovum.js","../src/core/location-hash.js","../src/core/defaults.js","../src/geonovum/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/geonovum/style.js","../src/geonovum/l10n.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/data-transform.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/geonovum/conformance.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.normal,\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\n */\nfunction smartypants(text) {\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n}\n\n/**\n * mangle email addresses\n * @param {string} text\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${level}>\\n`;\n }\n\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `<li>${text}</li>\\n`;\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `<tbody>${body}</tbody>`;\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = parser(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...marked.defaults, ...opt };\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: #193766;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: white;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/geonovum/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/geonovum/style.js\"),\n import(\"../src/geonovum/l10n.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/geonovum/conformance.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for Geonovum documents\n */\nexport const name = \"geonovum/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"cc-by-nd\",\n {\n name: \"Creative Commons Attribution-NoDerivatives 4.0 International Public License\",\n short: \"CC-BY-ND\",\n url: \"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl\",\n },\n ],\n]);\n\nconst geonovumDefaults = {\n lint: {\n \"privsec-section\": true,\n },\n doJsonLd: true,\n license: \"cc-by\",\n specStatus: \"GN-BASIS\",\n logos: [\n {\n src: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n alt: \"Geonovum\",\n id: \"Geonovum\",\n height: 67,\n width: 132,\n url: \"https://www.geonovum.nl/\",\n },\n ],\n};\n\nfunction computeProps(conf) {\n return {\n isCCBY: conf.license === \"cc-by\",\n licenseInfo: licenses.get(conf.license),\n isBasic: conf.specStatus === \"GN-BASIS\",\n isRegular: conf.specStatus === \"GN-BASIS\",\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...geonovumDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...geonovumDefaults,\n ...conf,\n lint,\n });\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module geonovum/style\n// Inserts a link to the appropriate Geonovum style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"geonovum/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n script.addEventListener(\n \"load\",\n () => {\n if (window.location.hash) {\n window.location.href = window.location.hash;\n }\n },\n { once: true }\n );\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createStyle(css_name) {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = `https://tools.geostandaarden.nl/respec/style/${css_name}.css`;\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C fixup.js\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preconnect\", // for Geonovum styles and scripts.\n href: \"https://tools.geostandaarden.nl/\",\n },\n {\n hint: \"preload\", // all Geonovum specs import base.css.\n href: \"https://tools.geostandaarden.nl/respec/style/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all Geonovum specs show the logo.\n href: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n as: \"image\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// add favicon for Geonovum\nconst favicon = document.createElement(\"link\");\nfavicon.rel = \"shortcut icon\";\nfavicon.type = \"image/x-icon\";\nfavicon.href =\n \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico\";\ndocument.head.prepend(favicon);\n\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\n// export function run(conf, doc, cb) {\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.\";\n conf.specStatus = \"GN-BASIS\";\n showWarning(msg, name);\n }\n\n if (document.body.querySelector(\"figure.scalable\")) {\n // Apply leaflet style if class scalable is present\n document.head.appendChild(createStyle(\"leaflet\"));\n document.head.appendChild(createStyle(\"font-awesome\"));\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"GN-WV\":\n styleFile += \"GN-WV.css\";\n break;\n case \"GN-CV\":\n styleFile += \"GN-CV.css\";\n break;\n case \"GN-VV\":\n styleFile += \"GN-VV.css\";\n break;\n case \"GN-DEF\":\n styleFile += \"GN-DEF.css\";\n break;\n case \"GN-BASIS\":\n styleFile += \"GN-BASIS.css\";\n break;\n default:\n styleFile = \"base.css\";\n }\n\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://tools.geostandaarden.nl/respec/style/${styleFile}`;\n linkCSS(document, finalStyleURL);\n}\n","// @ts-check\n// Module geonovum/l10n\n// Looks at the lang attribute on the root element and uses it to manage the config.l10n object so\n// that other parts of the system can localise their text\nimport { html } from \"../core/import-maps.js\";\nimport { l10n } from \"../core/l10n.js\";\nexport const name = \"geonovum/l10n\";\nconst additions = {\n en: {\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. Other documents may supersede\n this document. A list of current Geonovum publications and the latest\n revision of this document can be found via\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >(in Dutch).`,\n },\n nl: {\n status_at_publication: html`Deze paragraaf beschrijft de status van dit\n document ten tijde van publicatie. Het is mogelijk dat er actuelere\n versies van dit document bestaan. Een lijst van Geonovum publicaties en de\n laatste gepubliceerde versie van dit document zijn te vinden op\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >.`,\n },\n};\n\nObject.keys(additions).forEach(key => {\n if (!l10n[key]) l10n[key] = {};\n Object.assign(l10n[key], additions[key]);\n});\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"참조\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY?\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before {\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n return dfnsByType.get(linkType) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module geonovum/conformance\n// Handle the conformance section properly.\n// based on W3C conformance, but because Geonovum has different requirements, have a separate module\nimport { html } from \"../core/import-maps.js\";\nexport const name = \"geonovum/conformance\";\n\n/**\n * @param {Element} conformance\n */\nfunction processConformance(conformance) {\n const content = html`\n <h2>Conformiteit</h2>\n <p>\n Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle\n diagrammen, voorbeelden, en noten in dit document niet normatief. Verder\n is alles in dit document normatief.\n </p>\n <p>Informatief en normatief.</p>\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run() {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance) {\n processConformance(conformance);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"仕様検索\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"搜索 Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"🔎\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${\"[testSuiteURI]\"} が見つかりません.`,\n tests: \"テスト\",\n test: \"テスト\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`本规范中包含测试,但在 ReSpec 配置中缺少 ${\"[testSuiteURI]\"}。`,\n tests: \"测试\",\n test: \"测试\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"🔒\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"💪\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n showError(l10n.missing_test_suite_uri, name);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","docLang","startsWith","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","addQuotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$f","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$o","style$1","l10n$m","github$1","dataInclude","reindent$1","dataTransform","inlines","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","conformance","saveHtml","searchSpecref","aboutRespec","seo","dataTests","listSorter","highlightVars$1","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","geonovumDefaults","doJsonLd","license","logos","alt","height","width","isCCBY","licenseInfo","isBasic","isRegular","computeProps","css$d","noReSpecCSS","createStyle","css_name","resourceHints","createResourceHints","favicon","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","urls","frag","reduce","nextLink","linkCSS","additions","status_at_publication","nl","resolveGithubPromise","rejectGithubPromise","github","file_a_bug","participate","commit_history","ko","zh","ja","es","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","commitHistoryURL","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","shortName","githubAPI","hostname","excludeGithubLinks","otherLink","normalizedGHObj","apiBase","fullName","issuesURL","pullsURL","newIssuesURL","normalizedConfig","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","Date","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","headers","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","authors","etAl","publisher","date","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","contains","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","terms","plurals","userDefinedPlurals","uniquePlurals","css$b","makeTitle","num","report","number","div","inAside","exampleTitle","css$9","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","note","handleIssues","ins","ghIssues","getIssueNumber","Number","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","insertAdjacentHTML","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","every","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","editors","editor","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","toISOString","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","processConformance","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","publishDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$7","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","testSuiteURI","handleDuplicates","testURLs","codedJoinAnd","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$5","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EA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2CAA4C,WAC7C,CAAC,oBAAqB,SACtB,CAAC,uBAAwB,SACzB,CAAC,oBAAqB,QACtB,CAAC,gDAAiD,UAClD,CAAC,gCAAiC,SAClC,CAAC,sBAAuB,UACxB,CAAC,oBAAqB,SACtB,CAAC,SAAU,MACX,CAAC,WAAY,OACb,CAAC,OAAQ,QACT3F,SAAQ,SAAU2F,GAClB,OAAOR,EAAU2B,cAAcnB,EAAK,GAAIA,EAAK,GAClD,IAKG,CACE,CAAC,MAAO,IACR,CAAC,SAAU,MACX,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACV3F,SAAQ,SAAU2F,GAClB,OAAOR,EAAU6B,gBAAgBrB,EAAK,GAAIA,EAAK,GACpD,IAKG,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA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ignoreList":[4,5,6,7,9]} \ No newline at end of file diff --git a/builds/respec-w3c.js b/builds/respec-w3c.js index a359779827..2b8a4be865 100644 --- a/builds/respec-w3c.js +++ b/builds/respec-w3c.js @@ -1,5 +1,5 @@ -window.respecVersion="32.8.0",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function s(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:s});const i=["githubToken","githubUser"];const o=document.documentElement;o&&!o.hasAttribute("lang")&&(o.lang="en",o.hasAttribute("dir")||(o.dir="ltr"));const a={},c=o.lang;var l=Object.freeze({__proto__:null,l10n:a,lang:c,name:"core/l10n",run:function(e){e.l10n=a[c]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply($(this),t),v(p.get(this))}:function(...t){return v(e.apply($(this),t))}:function(t,...n){const r=e.call($(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(f.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const $=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],x=["put","add","delete","clear"],_=new Map;function C(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=x.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!k.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),s&&i.done]))[0]};return _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>C(t,n)||e.get(t,n,r),has:(t,n)=>!!C(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=v(o);return r&&o.addEventListener("upgradeneeded",(e=>{r(v(o.result),e.oldVersion,e.newVersion,v(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),s&&e.addEventListener("versionchange",(e=>s(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:$,wrap:v});function R(e,t,n,r,s,{level:i="error",autofix:o,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const s=n.map((e=>e.trivia+e.value)).join(""),i=e[t];return"eof"===i.type?s:r?s+i.trivia:s.slice(i.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?` in ${e.name}`:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map((e=>function(e,t){let n=e;return t&&(n+=` ${t}`),n}(e.type,e.name))).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:i,ruleName:a,autofix:o,input:f,tokens:p}}function E(e,t,n,r){return R(e,t,n,r,"Syntax")}function A(e,t,n,r,s={}){return s.ruleName=n,R(t.source,e.index,t,r,"Validation",s)}class T{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function L(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const s=L(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=L(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function P(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some((e=>e.required));if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?P(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class I extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class D extends T{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new D({source:e.source,tokens:{value:n}})}}get value(){return J(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class N extends D{static parse(e){const t=e.consumeKind("eof");if(t)return new N({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function O(e,t){return X(e,{parser:D.parser(e,t),listName:t+" list"})}const j=["identifier","decimal","integer","string"],z=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function M(e){for(const t of j){const n=O(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class q extends T{static parse(e){const t={assign:e.consume("=")},n=le(new q({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...j)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?M(e):ne(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map((n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e))),e.token(this.tokens.close)])}}class U extends T{static parse(e){const t=e.consumeKind("identifier");if(t)return new U({source:e.source,tokens:{name:t},params:q.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?J(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield A(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(z.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${z.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield A(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=z.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class W extends I{static parse(e){const t={};t.open=e.consume("[");const n=new W({source:e.source,tokens:t});return t.open?(n.push(...X(e,{parser:U.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map((t=>t.write(e))),e.token(this.tokens.close)]):""}}function F(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function B(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=le(new H({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error(`No opening bracket after ${n.value}`),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=se(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=re(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...pe)||e.error(`Record key must be one of: ${pe.join(", ")}`),s=new H({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const i=re(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,i);break}}return r.idlType||e.error(`Error parsing generic type ${n.value}`),r.tokens.close=e.consume(">")||e.error(`Missing closing bracket after ${n.value}`),r.this}(e,t)||te(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...pe,...de);if(!t)return;n=new H({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error(`Unsupported generic type ${t.value}`)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,F(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class H extends T{static parse(e,t){return B(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=le(new H({source:e.source,tokens:n}));for(r.type=t||null;;){const t=re(e)||e.error("No type after open parenthesis or 'or' in union type");"any"===t.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===t.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(t);const n=e.consume("or");if(!n)break;t.tokens.separator=n}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),F(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new W({source:e,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return J([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((e=>e)).map((e=>e.value)).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield A(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=L(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield A(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map((t=>t.write(e))),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}class G extends T{static parse(e){const t=e.consume("=");if(!t)return null;const n=Q(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new G({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return ee(this.expression[0]).type}get value(){return ee(this.expression[0]).value}get negative(){return ee(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map((t=>e.token(t)))])}}class V extends T{static parse(e){const t=e.position,n={},r=le(new V({source:e.source,tokens:n}));return r.extAttrs=W.parse(e),n.optional=e.consume("optional"),r.idlType=re(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...fe),n.name?(r.default=n.optional?G.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return J(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=L(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield A(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield A(this.tokens.name,this,"dict-arg-default",e,{autofix:Y(this)})}}else if(this.parent&&!P(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e);return!t.slice(n+1).some((e=>!e.optional))}(this)){const e="Dictionary argument must be optional if it has no required fields";yield A(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=ce(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",Y(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function Y(e){return()=>{e.default=G.parse(new be(" = {}"))}}class K extends T{static parse(e,{special:t,regular:n}={}){const r={special:t},s=le(new K({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=se(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=ne(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?J(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield A(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class Z extends T{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,i={special:t},o=le(new Z({source:e.source,tokens:i}));if(t||n||(i.special=e.consume("inherit")),"inherit"===o.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),i.readonly=e.consume("readonly"),r&&!i.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),i.base=e.consume("attribute"),i.base)return o.idlType=re(e,"attribute-type")||e.error("Attribute lacks a type"),i.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),i.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),o.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return J(this.tokens.name.value)}*validate(e){switch(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),this.idlType.generic){case"sequence":case"record":{const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield A(this.tokens.name,this,"attr-invalid-type",e);break}default:{const{reference:t}=L(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield A(e,this,"attr-invalid-type",n)}}}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function J(e){return e.startsWith("_")?e.slice(1):e}function X(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const i=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error(`Trailing comma in ${r}`);break}if(s.tokens.separator=e.consume(","),i.push(s),!s.tokens.separator)break}return i}function Q(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function ee({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function te(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new H({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new H({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new H({source:t,tokens:{base:r}}):void 0}function ne(e){return X(e,{parser:V.parse,listName:"arguments list"})}function re(e,t){const n=W.parse(e),r=H.parse(e,t);return r&&(le(r).extAttrs=n),r}function se(e,t){const n=H.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new H({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ie(e){const t=e.consume("stringifier");if(!t)return;return Z.parse(e,{special:t})||K.parse(e,{special:t})||e.error("Unterminated stringifier")}function oe(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function ae(e){return()=>{if(e.extAttrs.length){const t=new be("Exposed=Window,"),n=U.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=` ${r.tokens.name.trivia}`),e.extAttrs.unshift(n)}else{le(e).extAttrs=W.parse(new be("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${oe(t)}`}}}function ce(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return ce(e.idlType);return Object.values(e.tokens).sort(((e,t)=>e.index-t.index))[0]}function le(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?le(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}})}const ue={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},de=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float32Array","Float64Array","any","object","symbol"],pe=["ByteString","DOMString","USVString"],fe=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],he=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(fe,pe,de),me=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],ge=["_constructor","toString","_toString"];class be{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,i=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=o("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=o("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;s+=(e.match(/\n/g)||[]).length,r+=e,i-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=o("decimal"),-1===c&&(c=o("integer")),-1===c){c=o("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(ge.includes(n.value)){const r=`${J(n.value)} is a reserved identifier and must not be used.`;throw new ye(E(t,e,null,r))}he.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=o("string"));for(const o of me)if(e.startsWith(o,n)){t.push({type:"inline",value:o,trivia:r,line:s,index:i}),r="",n+=o.length,c=n;break}if(-1===c&&(c=o("other")),-1===c)throw new Error("Token stream not progressing");n=c,i+=1}return t.push({type:"eof",value:"",trivia:r,line:s,index:i}),t;function o(o,{noFlushTrivia:a}={}){const c=ue[o];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:o,value:l[0],trivia:r,line:s,index:i}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new ye(E(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class ye extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:i,tokens:o}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=i,this.tokens=o}}class we extends D{static parse(e){const t=e.consumeKind("string");if(t)return new we({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class ve extends T{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=le(new ve({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=X(e,{parser:we.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return J(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class $e extends T{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new $e({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return J(this.tokens.target.value)}get includes(){return J(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class ke extends T{static parse(e){const t={},n=le(new ke({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=re(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return J(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class xe extends T{static parse(e,t){const n={base:t},r=le(new xe({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=se(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=ne(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return J(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map((t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class _e extends T{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:i}=t;for(s.name=e.consumeKind("identifier")||e.error(`Missing name in ${i}`),e.current=t,t=le(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error(`Bodyless ${i}`),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error(`Missing semicolon after ${i}`),t.this;const n=W.parse(e);let o;for(const[t,...n]of r)if(o=le(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=n,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return J(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?J(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Ce extends T{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=te(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new H({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=Q(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Ce({source:e.source,tokens:t});return le(r).idlType=n,r}get type(){return"const"}get name(){return J(this.tokens.name.value)}get value(){return ee(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class Se extends T{static parse(e){const t=e.position,n=le(new Se({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:s}=n,i="maplike"===s,o=i||"iterable"===s,a=n.async&&"iterable"===s;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=re(e)||e.error(`Missing a type argument in ${s} declaration`);return n.idlType=[c],n.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(re(e)):i&&e.error(`Missing second type argument in ${s} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...ne(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),n.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class Re extends T{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=ne(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new Re({source:e.source,tokens:n});return le(s).arguments=r,s}get type(){return"constructor"}*validate(e){for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function Ee(e){const t=e.consume("static");if(!t)return;return Z.parse(e,{special:t})||K.parse(e,{special:t})||e.error("No body in static member")}class Ae extends _e{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return _e.parse(e,new Ae({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[Ce.parse],[Re.parse],[Ee],[ie],[Se.parse],[Z.parse],[K.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield A(this.tokens.name,this,"require-exposed",e,{autofix:ae(this)})}const t=this.extAttrs.filter((e=>"Constructor"===e.name));for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield A(e.tokens.name,this,"constructor-member",t,{autofix:Te(this,e)})}if(this.extAttrs.some((e=>"Global"===e.name))){const e=this.extAttrs.filter((e=>"LegacyFactoryFunction"===e.name));for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield A(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter((e=>"constructor"===e.type));for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield A(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=o(e);return{statics:new Set(t.filter((e=>"static"===e.special)).map((e=>e.name))),nonstatics:new Set(t.filter((e=>"static"!==e.special)).map((e=>e.name)))}}(t),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=o(e),s=r.filter((e=>"static"===e.special)),a=r.filter((e=>"static"!==e.special));yield*i(s,n.statics,e,t),yield*i(a,n.nonstatics,e,t),s.forEach((e=>n.statics.add(e.name))),a.forEach((e=>n.nonstatics.add(e.name)))}function*i(e,t,n,r){for(const s of e){const{name:e}=s;if(e&&t.has(e)){const t=`The ${"static"===s.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield A(s.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter((({type:e})=>"operation"===e))}}(e,this))}}function Te(e,t){return e=le(e),()=>{const n=oe(e.extAttrs.tokens.open.trivia),r=e.members.length?oe(ce(e.members[0]).trivia):function(e){const t=oe(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=Re.parse(new be(`\n${r}constructor();`));s.extAttrs=new W({source:e.source,tokens:{}}),le(s).arguments=t.arguments;const i=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,(e=>"constructor"===e.type));e.members.splice(i+1,0,s);const{close:o}=e.tokens;o.trivia.includes("\n")||(o.trivia+=`\n${n}`);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class Le extends _e{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return _e.parse(e,new Le({source:e.source,tokens:r}),{allowedMembers:[[Ce.parse],[ie],[Z.parse,{noInherit:!0}],[K.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Pe extends T{static parse(e){const t={},n=le(new Pe({source:e.source,tokens:t}));return n.extAttrs=W.parse(e),t.required=e.consume("required"),n.idlType=re(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=G.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return J(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class Ie extends _e{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return _e.parse(e,new Ie({source:e.source,tokens:n}),{inheritable:!t,allowedMembers:[[Pe.parse]]})}get type(){return"dictionary"}}class De extends _e{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return _e.parse(e,new De({source:e.source,tokens:n}),{allowedMembers:[[Z.parse,{noInherit:!0,readonly:!0}],[Ce.parse],[K.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield A(this.tokens.name,this,"require-exposed",e,{autofix:ae(this)})}yield*super.validate(e)}}class Ne extends _e{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return _e.parse(e,new Ne({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[Ce.parse],[K.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Oe(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function i(t){const n=s("interface");if(!n)return;return Le.parse(e,n,t)||Ae.parse(e,n,t)||r("Interface has no proper body")}function o(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const t=s("callback");if(t)return e.probe("interface")?Ne.parse(e,t):xe.parse(e,t)}()||i()||function(){const t=s("partial");if(t)return Ie.parse(e,{partial:t})||i({partial:t})||De.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Ie.parse(e)||ve.parse(e)||ke.parse(e)||$e.parse(e)||De.parse(e)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=W.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}le(n).extAttrs=t,s.push(n)}const i=N.parse(e);return t.concrete&&s.push(i),s}();return e.position<n.length&&r("Unrecognised tokens"),a}function je(e){return e}const ze={wrap:e=>e.join(""),trivia:je,name:je,reference:je,type:je,generic:je,nameless:je,inheritance:je,definition:je,extendedAttribute:je,extendedAttributeReference:je};class Me{constructor(e){this.ts=Object.assign({},ze,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=je,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function qe(e,t){const n=new Map,r=e.filter((e=>"includes"===e.type));for(const e of r){const r=t.get(e.includes);if(!r)continue;const s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Ue(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:qe(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield A(n.tokens.name,n,"no-duplicate",r)}}(t)}var We=Object.freeze({__proto__:null,WebIDLParseError:ye,parse:function(e,t={}){const n=new be(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Oe(n,t)},validate:function(e){return[...Ue((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=ze}={}){t=Object.assign({},ze,t);const n=new Me(t);return t.wrap(e.map((e=>e.write(n))))}});const Fe=/^[!#$%&'*+-.^`|~\w]+$/,Be=/[\u000A\u000D\u0009\u0020]/u,He=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function Ge(e,t,n){(t&&""!==t&&!e.has(t)&&He.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function Ve(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ye={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Ke=/[&<>"']/,Ze=new RegExp(Ke.source,"g"),Je=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Xe=new RegExp(Je.source,"g"),Qe={"&":"&","<":"<",">":">",'"':""","'":"'"},et=e=>Qe[e];function tt(e,t){if(t){if(Ke.test(e))return e.replace(Ze,et)}else if(Je.test(e))return e.replace(Xe,et);return e}const nt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function rt(e){return e.replace(nt,((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 st=/(^|[^\[])\^/g;function it(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(st,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const ot=/[^\w:]/g,at=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ct(e,t,n){if(e){let e;try{e=decodeURIComponent(rt(n)).replace(ot,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!at.test(n)&&(n=function(e,t){lt[" "+e]||(ut.test(e)?lt[" "+e]=e+"/":lt[" "+e]=gt(e,"/",!0));const n=-1===(e=lt[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(dt,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(pt,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const lt={},ut=/^[^:]+:\/*[^/]*$/,dt=/^([^:]+:)[\s\S]*$/,pt=/^([^:]+:\/*[^/]*)[\s\S]*$/;const ft={exec:function(){}};function ht(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function mt(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),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 gt(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function bt(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function yt(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function wt(e,t,n,r){const s=t.href,i=t.title?tt(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:tt(o)}}class vt{constructor(e){this.options=e||Ye}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:gt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=gt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,s,i,o,a,c,l,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),l=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=l.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=l.slice(i),i+=t[1].length),a=!1,!l&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!s.test(u))&&!o.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(l.search(/[^ ]/)>=4)break;if(s.test(l))break;if(o.test(l))break;if(r.test(l))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),l=u.slice(i)}}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(s="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:s,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(o=0;o<y;o++)if(this.lexer.state.top=!1,g.items[o].tokens=this.lexer.blockTokens(g.items[o].text,[]),!g.loose){const e=g.items[o].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(o=0;o<y;o++)g.items[o].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):tt(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:mt(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,s,i,o=e.align.length;for(n=0;n<o;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(o=e.rows.length,n=0;n<o;n++)e.rows[n]=mt(e.rows[n],e.header.length).map((e=>({text:e})));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],s=0;s<i.length;s++)i[s].tokens=this.lexer.inline(i[s].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:tt(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):tt(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=gt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,s=0;for(;s<n;s++)if("\\"===e[s])s++;else if(e[s]===t[0])r++;else if(e[s]===t[1]&&(r--,r<0))return s;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),wt(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return wt(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const s=r[1]||r[2]||"";if(!s||s&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let s,i,o=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=s.length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);const t=e.slice(0,n+r.index+(r[0].length-s.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const c=t.slice(2,-2);return{type:"strong",raw:t,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=tt(e,!0),{type:"codespan",raw:t[0],text:e}}}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[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=tt(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=tt(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=tt(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=tt(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):tt(n[0]):n[0]:tt(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const $t={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\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 *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:ft,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};$t.def=it($t.def).replace("label",$t._label).replace("title",$t._title).getRegex(),$t.bullet=/(?:[*+-]|\d{1,9}[.)])/,$t.listItemStart=it(/^( *)(bull) */).replace("bull",$t.bullet).getRegex(),$t.list=it($t.list).replace(/bull/g,$t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$t.def.source+")").getRegex(),$t._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",$t._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,$t.html=it($t.html,"i").replace("comment",$t._comment).replace("tag",$t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$t.paragraph=it($t._paragraph).replace("hr",$t.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$t._tag).getRegex(),$t.blockquote=it($t.blockquote).replace("paragraph",$t.paragraph).getRegex(),$t.normal=ht({},$t),$t.gfm=ht({},$t.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),$t.gfm.table=it($t.gfm.table).replace("hr",$t.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$t._tag).getRegex(),$t.gfm.paragraph=it($t._paragraph).replace("hr",$t.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",$t.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$t._tag).getRegex(),$t.pedantic=ht({},$t.normal,{html:it("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",$t._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+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it($t.normal._paragraph).replace("hr",$t.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",$t.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const kt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ft,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)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ft,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function xt(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function _t(e){let t,n,r="";const s=e.length;for(t=0;t<s;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}kt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",kt.punctuation=it(kt.punctuation).replace(/punctuation/g,kt._punctuation).getRegex(),kt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,kt.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,kt._comment=it($t._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),kt.emStrong.lDelim=it(kt.emStrong.lDelim).replace(/punct/g,kt._punctuation).getRegex(),kt.emStrong.rDelimAst=it(kt.emStrong.rDelimAst,"g").replace(/punct/g,kt._punctuation).getRegex(),kt.emStrong.rDelimUnd=it(kt.emStrong.rDelimUnd,"g").replace(/punct/g,kt._punctuation).getRegex(),kt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,kt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,kt._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])?)+(?![-_])/,kt.autolink=it(kt.autolink).replace("scheme",kt._scheme).replace("email",kt._email).getRegex(),kt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,kt.tag=it(kt.tag).replace("comment",kt._comment).replace("attribute",kt._attribute).getRegex(),kt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,kt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,kt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,kt.link=it(kt.link).replace("label",kt._label).replace("href",kt._href).replace("title",kt._title).getRegex(),kt.reflink=it(kt.reflink).replace("label",kt._label).replace("ref",$t._label).getRegex(),kt.nolink=it(kt.nolink).replace("ref",$t._label).getRegex(),kt.reflinkSearch=it(kt.reflinkSearch,"g").replace("reflink",kt.reflink).replace("nolink",kt.nolink).getRegex(),kt.normal=ht({},kt),kt.pedantic=ht({},kt.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",kt._label).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kt._label).getRegex()}),kt.gfm=ht({},kt.normal,{escape:it(kt.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),kt.gfm.url=it(kt.gfm.url,"i").replace("email",kt.gfm._extended_email).getRegex(),kt.breaks=ht({},kt.gfm,{br:it(kt.br).replace("{2,}","*").getRegex(),text:it(kt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class Ct{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ye,this.options.tokenizer=this.options.tokenizer||new vt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:$t.normal,inline:kt.normal};this.options.pedantic?(t.block=$t.pedantic,t.inline=kt.pedantic):this.options.gfm&&(t.block=$t.gfm,this.options.breaks?t.inline=kt.breaks:t.inline=kt.gfm),this.tokenizer.rules=t}static get rules(){return{block:$t,inline:kt}}static lex(e,t){return new Ct(t).lex(e)}static lexInline(e,t){return new Ct(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,i,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+yt("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+yt("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index+i[0].length-2)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,_t))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,_t))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s,xt))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}let St=class{constructor(e){this.options=e||Ye}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+tt(r)+'">'+(n?e:tt(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:tt(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=ct(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=ct(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class Rt{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,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Et{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class At{constructor(e){this.options=e||Ye,this.options.renderer=this.options.renderer||new St,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Rt,this.slugger=new Et}static parse(e,t){return new At(t).parse(e)}static parseInline(e,t){return new At(t).parseInline(e)}parse(e,t=!0){let n,r,s,i,o,a,c,l,u,d,p,f,h,m,g,b,y,w,v,$="";const k=e.length;for(n=0;n<k;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))$+=v||"";else switch(d.type){case"space":continue;case"hr":$+=this.renderer.hr();continue;case"heading":$+=this.renderer.heading(this.parseInline(d.tokens),d.depth,rt(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":$+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(l="",c="",i=d.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(l+=this.renderer.tablerow(c),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],c="",o=a.length,s=0;s<o;s++)c+=this.renderer.tablecell(this.parseInline(a[s].tokens),{header:!1,align:d.align[s]});u+=this.renderer.tablerow(c)}$+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(d.tokens),$+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);$+=this.renderer.list(u,p,f);continue;case"html":$+=this.renderer.html(d.text);continue;case"paragraph":$+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);$+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return $}parseInline(e,t){t=t||this.renderer;let n,r,s,i="";const o=e.length;for(n=0;n<o;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(s=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==s||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=s||"";else switch(r.type){case"escape":case"text":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function Tt(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("function"==typeof t&&(n=t,t=null),bt(t=ht({},Tt.defaults,t||{})),n){const r=t.highlight;let s;try{s=Ct.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&Tt.walkTokens(s,t.walkTokens),i=At.parse(s,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,i)};if(!r||r.length<3)return i();if(delete t.highlight,!s.length)return i();let o=0;return Tt.walkTokens(s,(function(e){"code"===e.type&&(o++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),o--,0===o&&i()}))}),0))})),void(0===o&&i())}function r(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+tt(e.message+"",!0)+"</pre>";throw e}try{const n=Ct.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(Tt.walkTokens(n,t.walkTokens)).then((()=>At.parse(n,t))).catch(r);Tt.walkTokens(n,t.walkTokens)}return At.parse(n,t)}catch(e){r(e)}}Tt.options=Tt.setOptions=function(e){var t;return ht(Tt.defaults,e),t=Tt.defaults,Ye=t,Tt},Tt.getDefaults=Ve,Tt.defaults=Ye,Tt.use=function(...e){const t=Tt.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n=ht({},e);if(n.async=Tt.defaults.async||n.async,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=Tt.defaults.renderer||new St;for(const n in e.renderer){const r=t[n];t[n]=(...s)=>{let i=e.renderer[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.renderer=t}if(e.tokenizer){const t=Tt.defaults.tokenizer||new vt;for(const n in e.tokenizer){const r=t[n];t[n]=(...s)=>{let i=e.tokenizer[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.tokenizer=t}if(e.walkTokens){const t=Tt.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}Tt.setOptions(n)}))},Tt.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Tt,r)),r.type){case"table":for(const e of r.header)n=n.concat(Tt.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(Tt.walkTokens(r.tokens,t));break;case"list":n=n.concat(Tt.walkTokens(r.items,t));break;default:Tt.defaults.extensions&&Tt.defaults.extensions.childTokens&&Tt.defaults.extensions.childTokens[r.type]?Tt.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(Tt.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(Tt.walkTokens(r.tokens,t)))}return n},Tt.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");bt(t=ht({},Tt.defaults,t||{}));try{const n=Ct.lexInline(e,t);return t.walkTokens&&Tt.walkTokens(n,t.walkTokens),At.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+tt(e.message+"",!0)+"</pre>";throw e}},Tt.Parser=At,Tt.parser=At.parse,Tt.Renderer=St,Tt.TextRenderer=Rt,Tt.Lexer=Ct,Tt.lexer=Ct.lex,Tt.Tokenizer=vt,Tt.Slugger=Et,Tt.parse=Tt,Tt.options,Tt.setOptions,Tt.use,Tt.walkTokens,Tt.parseInline,At.parse,Ct.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Lt,Pt={};Lt={get exports(){return Pt},set exports(e){Pt=e}},function(e,t){Lt.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function o(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function c(e,t){return e.replace(t[0],(function(n,r){var s=a(t[1],arguments);return o(""===n?e[r-1]:n,s)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var i=r[s];if(i[0].test(t))return c(t,i)}return t}function u(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?o(r,s):e.hasOwnProperty(s)?o(r,e[s]):l(s,r,n)}}function d(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&l(s,s,n)===s}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(s,r,e),p.isPlural=d(s,r,e),p.singular=u(r,s,t),p.isSingular=d(r,s,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),s[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var It=Pt,Dt=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=i.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,i){for(var o=("selectedIndex"in t),a=o;r<s;){var c,l=e(n[r],1);t.insertBefore(l,i),o&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function i(e,t){return e==t}function o(e){return e}function a(e,t,n,r,s,i,o){var a=i-s;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=s;c<n&&l<i&&o(e[c],r[l]);)c++,l++;if(l===i)return t;t=c+1}return-1}function c(e,t,n,r,s){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,s=t;r<s;){var i=(r+s)/2>>>0;n<e[i]?s=i:r=1+i}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||o,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return s(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var $=m-g,k=b-y,x=-1;if($<k){if(-1<(x=a(n,y,b,t,g,m,u)))return s(d,e,n,y,x,d(t[g],0)),s(d,e,n,x+$,b,c(d,t,m,h,f)),n}else if(k<$&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+k,m),n;return $<2||k<2?(s(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):$==k&&function(e,t,n,r,s,i){for(;r<s&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?s(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,i,o,a,c,u,d,f,h,m){!function(e,t,n,r,i,o,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:i++,f++;break;case 1:d.push(r[i]),s(t,n,r,i++,i,f<c?t(o[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(o[a])?a++:l(t,o,a++,a)}}(function(e,t,n,r,s,i,o){var a,c,l,u,d,p,f=n+i,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<i&&c<n&&o(r[s+l],e[t+c]);)l++,c++;if(l===i&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&o(r[s+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,o,a,c,d,h)||function(e,t,n,r,s,i,o,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=o;for(var h=s.slice(i,o),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+i))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--o;d[c]>o;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,$=w.oldi;v<n;)y[--l]=1,--n;for(;$<o;)y[--l]=-1,--o;y[--l]=0,--n,--o,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;i<=o;)y[--l]=-1,--o;return y}(n,r,i,o,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,k,t,g,m,$,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(s){var i=r(s);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,s){e.call(r,n[s],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(s,i){return n[r(s)?e:t.push(s)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function $(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,_,C,S,R,E,A={},T={},L=[],P=T.hasOwnProperty,I=0,D={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(I=L.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<I;n++){var r=L[n];if(P.call(e,r))return T[r](e[r],t)}}},N=Array.isArray||(_=(x={}.toString).call([]),function(e){return x.call(e)===_}),O=(C=e,S="fragment",E="content"in z(R="template")?function(e){var t=z(R);return t.innerHTML=e,t.content}:function(e){var t,n=z(S),r=z(R);return j(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(S),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",j(t,n.firstChild.childNodes),t}:E)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===S?C.createDocumentFragment():C.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,U,W,F,B,H,G,V,Y=(q="appendChild",U="cloneNode",W="createTextNode",B=(F="importNode")in(M=e),(H=M.createDocumentFragment())[q](M[W]("g")),H[q](M[W]("")),(B?M[F](H,!0):H[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),s=t.childNodes||[],i=s.length,o=0;n&&o<i;o++)r[q](e(s[o],n));return r}:B?M[F]:function(e,t){return e[U](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Z="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Z+'"></p>',G.content.childNodes[0].getAttribute(V)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Z+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,se="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",oe=new RegExp(se+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(se+re+ie+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,ue)+r}function ue(e,t,n){return t+(n||'"')+Z+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,s){for(var i=t.childNodes,o=i.length,a=0;a<o;){var c=i[a];switch(c.nodeType){case 1:var l=s.concat(a);!function(t,n,r,s){for(var i,o=t.attributes,a=[],c=[],l=pe(o,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Z;if(f||1<(i=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=o[m]||o[m.toLowerCase()];if(f)n.push(he(g,s,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(he(g,s,m,i))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var $=e.createElement(v);for(u=o.length,d=0;d<u;)$.setAttributeNode(o[d++].cloneNode(!0));$.textContent=t.textContent,t.parentNode.replaceChild($,t)}}(c,n,r,l),fe(c,n,r,l);break;case 8:var u=c.textContent;if(u===Z)r.shift(),n.push(Q.test(t.nodeName)?me(t,s):{type:"any",node:c,path:s.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(c),a--,o--}break;case 3:Q.test(t.nodeName)&&K.call(c.textContent)===X&&(r.shift(),n.push(me(t,s)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(oe,le)})(t),r=e.transform;r&&(n=r(n));var s=O(n,e.type);ve(s);var i=[];return fe(s,i,t.slice(0),[]),{content:s,updates:function(n){for(var r=[],s=i.length,o=0,a=0;o<s;){var c=i[o++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var i=1,o=1;i<e;){var a=r[i-o];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(o+=d-2;u<d;)l+=arguments[i++]+c[u++];a.fn(l)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var $e,ke,xe=($e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Ce(n,!0)}(e,t):Ce(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Ce(e,t){var n,r;return function(s){var i,o,a,c;switch(typeof s){case"object":if(s){if("object"===n){if(!t&&r!==s)for(o in r)o in s||(e[o]="")}else t?e.value="":e.cssText="";for(o in i=t?{}:e,s)a="number"!=typeof(c=s[o])||$e.test(o)?c:c+"px",!t&&/^--/.test(o)?i.setProperty(o,a):i[o]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=i):r=s;break}default:r!=s&&(n="string",r=s,t?e.value=s||"":e.cssText=s||"")}}}var Se,Re,Ee=(Se=[].slice,(Re=Ae.prototype).ELEMENT_NODE=1,Re.nodeType=111,Re.remove=function(e){var t,n=this.childNodes,r=this.firstChild,s=this.lastChild;return this._=null,e&&2===n.length?s.parentNode.removeChild(s):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(s),t.deleteContents()),r},Re.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,i=r.length;s<i;s++)t.appendChild(r[s]);return t},Ae);function Ae(e){var t=this.childNodes=Se.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Ue:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return Le(e.render(),t);default:return e}}function Pe(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Te).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Ie(e){return null!=e&&"then"in e}var De,Ne,Oe,je,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,Ue=Ee.prototype.nodeType,We=(Ne=(De={Event:b,WeakSet:u}).Event,Oe=De.WeakSet,je=!0,ze=null,function(e){return je&&(je=!je,ze=new Oe,function(e){var t=new Oe,n=new Oe;try{new MutationObserver(o).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,s=[],i=function(e){s.push(e),clearTimeout(r),r=setTimeout((function(){o(s.splice(r=0,s.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function o(e){for(var r,s=e.length,i=0;i<s;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var s,i=new Ne(t),o=e.length,a=0;a<o;1===(s=e[a++]).nodeType&&function e(t,n,r,s,i){ze.has(t)&&!s.has(t)&&(i.delete(t),s.add(t),t.dispatchEvent(n));for(var o=t.children||[],a=o.length,c=0;c<a;e(o[c++],n,r,s,i));}(s,i,t,n,r));}}(e.ownerDocument)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Be=[].slice;function He(t){return this.type=t,function(t){var n=we,r=ve;return function(s){var i,o,a;return n!==s&&(i=t,o=n=s,a=be.get(o)||be.set(o,ye(i,o)),r=a.updates(Y.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,s=Me in e;if("style"===t)return xe(e,n,s);if("."===t.slice(0,1))return l=e,u=t.slice(1),s?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return o=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(a,""):o.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?We(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!s&&t in e&&!Fe.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var s=D.attributes[t](e,n);r!==s&&(null==(r=s)?e.removeAttribute(t):e.setAttribute(t,s))};var o,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Le,before:e},s=Me in e?"svg":"html",i=!1;return function o(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":o(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=h(e.parentNode,t,[],r);break}default:if(i=!1,N(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":o({html:a});break;case"object":if(N(a[0])&&(a=a.concat.apply([],a)),Ie(a[0])){Promise.all(a).then(o);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Be.call(a.childNodes):[a],r):Ie(a)?a.then(o):"placeholder"in a?Pe(a,o):"text"in a?o(String(a.text)):"any"in a?o(a.any):"html"in a?t=h(e.parentNode,t,Be.call(O([].concat(a.html).join(""),s).childNodes),r):o("length"in a?Be.call(a):D.invoke(a,o))}var c}},text:function(e){var t;return function n(r){var s;t!==r&&("object"==(s=typeof(t=r))&&r?Ie(r)?r.then(n):"placeholder"in r?Pe(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Be.call(r).join(""):D.invoke(r,n)):"function"==s?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,s,i,o,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(s={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return s[t]||(s[t]=e)},Ve=c?i:(o=new n,function(e){return o.get(e)||(n=i(t=e),o.set(t,n),n);var t,n})):Ge=!0,Ye(t)};function Ye(e){return Ge?e:Ve(e)}function Ke(e){for(var t=arguments.length,n=[Ye(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ze=new n,Je=function(e){var t,n,r;return function(){var s=Ke.apply(null,arguments);return r!==s[0]?(r=s[0],n=new He(e),t=Qe(n.apply(n,s))):n.apply(n,s),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Ze.get(e),s=t;return-1<n&&(s=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ze.set(e,r={}),r[s]||(r[s]=Je(t))},Qe=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ee(t):e},et=new n;function tt(){var e=et.get(this),t=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(Me in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,st,it,ot=D.define,at=He.prototype;function ct(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?ct.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?ct.bind(e):Xe(e,"html"):("raw"in e?Je("html"):ct.wire).apply(null,arguments)}return ct.Component=v,ct.bind=function(e){return tt.bind(e)},ct.define=ot,ct.diff=h,(ct.hyper=ct).observe=We,ct.tagger=at,ct.wire=function(e,t){return null==e?Je(t||"html"):Xe(e,t||"html")},ct._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,st=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,s){var i,o,a,c=t.get(e)||it(e,t);switch(typeof s){case"object":case"function":var l=c.w||(c.w=new n);return l.get(s)||(i=l,o=s,a=new e(r),i.set(o,a),a);default:var u=c.p||(c.p=st(null));return u[s]||(u[s]=new e(r))}}(this,rt.get(e)||(r=e,s=new w,rt.set(r,s),s),e,null==t?"default":t);var r,s}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:$("html",nt),svg:$("svg",nt),state:$("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var s in r)n[s]=r[s];return!1!==t&&this.render(),this}}}),ct}(document); -/*! (c) Andrea Giammarchi (ISC) */const Nt=Dt,Ot=S,jt=Tt,zt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",s=null,i=new Map,o="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(o){case"type":if("/"===c){o="subtype";continue}t+=c;break;case"subtype":if(";"===c){o="param-start";continue}n+=c;break;case"param-start":if(Be.test(c)||";"===c)continue;r+=c,o="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){o="param-value",s=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){o="collect-quoted-string";continue}if(";"===c){s=s.trimEnd(),o="param-start",Ge(i,r,s),r="";continue}s="string"==typeof s?s+c:c;break;case"collect-quoted-string":if('"'===c){Ge(i,r,s),o="ignore-input-until-next-param",r="",s=null;continue}if("\\"===c)continue;s="string"==typeof s?s+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;o="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${o} `)}}r&&Ge(i,r,s);if(""===t.trim()||!Fe.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!Fe.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(i.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?Fe.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Mt=It,qt=We;function Ut(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Wt=Object.freeze({__proto__:null,name:"core/reindent",reindent:Ut,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Ut(e.innerHTML)}});const Ft=/-/g;const Bt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ht="en"===c||c.startsWith("en-")?"en-AU":c,Gt=new Intl.DateTimeFormat(Ht,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ht?"2-digit":"numeric"}),Vt=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function Yt(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Kt(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Zt(e,t="long"){const n=new Intl.ListFormat(c,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s))}}const Jt=Zt("conjunction"),Xt=Zt("disjunction");function Qt(e,t){return Jt(e,t).join("")}function en(e,t){return Xt(e,t).join("")}function tn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}function nn(e){return e.trim().replace(/\s+/g," ")}function rn(e,t=c){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=sn(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function sn(e,t,n=c){return e[n=n.toLowerCase()]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}function on(e,t=""){return Bt.format(e).replace(Ft,t)}function an(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Rn(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}async function cn(e,t=864e5){const n=new Request(e),r=new URL(n.url);let s,i;if("caches"in window)try{if(s=await caches.open(r.origin),i=await s.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const o=await fetch(n);if(!o.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(s&&o.ok){const e=o.clone(),r=new Headers(o.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return o}function ln(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Nt`${e}, `));return Nt`${r}${n[n.length-1]}`}function un(e,t){return[].concat(Jt(e,t)).map((e=>"string"==typeof e?Nt`${e}`:e))}function dn(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(nn(e.textContent));return pn(e,t,n)}function pn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s=`x${s}`):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function fn(e){const t=new Set,n="ltNodefault"in e.dataset?"":nn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>nn(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(nn(e))))}return[...t]}function hn(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function mn(e,t){const n=t.closest(Vt);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function gn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function bn(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function yn(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function wn(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class vn extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function $n(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{hn(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),kn(t),t}function kn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...xn(t)])e.remove()}function*xn(e){for(;e.nextNode();)yield e.currentNode}class _n extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Cn extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||pn(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:i,title:o,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:i,title:o,details:a,stack:n}}}function Sn(e,t,n={}){const s={...n,isWarning:!1};r("error",new Cn(e,t,s))}function Rn(e,t,n={}){const s={...n,isWarning:!0};r("warn",new Cn(e,t,s))}function En(e){return e?`\`${e}\``:""}function An(e,{quotes:t}={quotes:!1}){return en(e,t?e=>En(Ln(e)):En)}function Tn(e,{quotes:t}={quotes:!1}){return Qt(e,t?e=>En(Ln(e)):En)}function Ln(e){return String(e)?`"${e}"`:""}function Pn(e,...t){return Ut(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,i]=r.slice(1,-1).split("|");if(i){return`${e}[${s}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`})).join(""))}const In=new Map([["text/html","html"],["application/xml","xml"]]);function Dn(e,t=document){const n=In.get(e);if(!n){const t=[...In.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Nn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Nn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:s}=e;kn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Kt(s);const i=e.createDocumentFragment(),o=e.querySelector("meta[name='viewport']");o&&t.firstChild!==o&&i.appendChild(o);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=Nt`<meta charset="utf-8" />`);i.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Nt` +window.respecVersion="32.8.1",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function s(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:s});const i=["githubToken","githubUser"];const o=document.documentElement;o&&!o.hasAttribute("lang")&&(o.lang="en",o.hasAttribute("dir")||(o.dir="ltr"));const a={},c=o.lang;var l=Object.freeze({__proto__:null,l10n:a,lang:c,name:"core/l10n",run:function(e){e.l10n=a[c]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply($(this),t),v(p.get(this))}:function(...t){return v(e.apply($(this),t))}:function(t,...n){const r=e.call($(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(f.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const $=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],x=["put","add","delete","clear"],_=new Map;function C(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=x.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!k.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),s&&i.done]))[0]};return _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>C(t,n)||e.get(t,n,r),has:(t,n)=>!!C(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=v(o);return r&&o.addEventListener("upgradeneeded",(e=>{r(v(o.result),e.oldVersion,e.newVersion,v(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),s&&e.addEventListener("versionchange",(e=>s(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:$,wrap:v});function R(e,t,n,r,s,{level:i="error",autofix:o,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const s=n.map((e=>e.trivia+e.value)).join(""),i=e[t];return"eof"===i.type?s:r?s+i.trivia:s.slice(i.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?` in ${e.name}`:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map((e=>function(e,t){let n=e;return t&&(n+=` ${t}`),n}(e.type,e.name))).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:i,ruleName:a,autofix:o,input:f,tokens:p}}function E(e,t,n,r){return R(e,t,n,r,"Syntax")}function A(e,t,n,r,s={}){return s.ruleName=n,R(t.source,e.index,t,r,"Validation",s)}class T{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function L(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const s=L(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=L(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function P(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some((e=>e.required));if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?P(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class I extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class D extends T{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new D({source:e.source,tokens:{value:n}})}}get value(){return J(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class N extends D{static parse(e){const t=e.consumeKind("eof");if(t)return new N({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function O(e,t){return X(e,{parser:D.parser(e,t),listName:t+" list"})}const j=["identifier","decimal","integer","string"],z=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function M(e){for(const t of j){const n=O(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class q extends T{static parse(e){const t={assign:e.consume("=")},n=le(new q({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...j)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?M(e):ne(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map((n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e))),e.token(this.tokens.close)])}}class U extends T{static parse(e){const t=e.consumeKind("identifier");if(t)return new U({source:e.source,tokens:{name:t},params:q.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?J(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield A(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(z.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${z.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield A(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=z.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class W extends I{static parse(e){const t={};t.open=e.consume("[");const n=new W({source:e.source,tokens:t});return t.open?(n.push(...X(e,{parser:U.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map((t=>t.write(e))),e.token(this.tokens.close)]):""}}function F(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function B(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=le(new H({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error(`No opening bracket after ${n.value}`),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=se(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=re(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...pe)||e.error(`Record key must be one of: ${pe.join(", ")}`),s=new H({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const i=re(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,i);break}}return r.idlType||e.error(`Error parsing generic type ${n.value}`),r.tokens.close=e.consume(">")||e.error(`Missing closing bracket after ${n.value}`),r.this}(e,t)||te(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...pe,...de);if(!t)return;n=new H({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error(`Unsupported generic type ${t.value}`)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,F(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class H extends T{static parse(e,t){return B(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=le(new H({source:e.source,tokens:n}));for(r.type=t||null;;){const t=re(e)||e.error("No type after open parenthesis or 'or' in union type");"any"===t.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===t.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(t);const n=e.consume("or");if(!n)break;t.tokens.separator=n}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),F(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new W({source:e,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return J([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((e=>e)).map((e=>e.value)).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield A(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=L(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield A(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map((t=>t.write(e))),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}class G extends T{static parse(e){const t=e.consume("=");if(!t)return null;const n=Q(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new G({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return ee(this.expression[0]).type}get value(){return ee(this.expression[0]).value}get negative(){return ee(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map((t=>e.token(t)))])}}class V extends T{static parse(e){const t=e.position,n={},r=le(new V({source:e.source,tokens:n}));return r.extAttrs=W.parse(e),n.optional=e.consume("optional"),r.idlType=re(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...fe),n.name?(r.default=n.optional?G.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return J(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=L(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield A(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield A(this.tokens.name,this,"dict-arg-default",e,{autofix:Y(this)})}}else if(this.parent&&!P(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e);return!t.slice(n+1).some((e=>!e.optional))}(this)){const e="Dictionary argument must be optional if it has no required fields";yield A(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=ce(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",Y(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function Y(e){return()=>{e.default=G.parse(new be(" = {}"))}}class K extends T{static parse(e,{special:t,regular:n}={}){const r={special:t},s=le(new K({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=se(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=ne(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?J(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield A(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class Z extends T{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,i={special:t},o=le(new Z({source:e.source,tokens:i}));if(t||n||(i.special=e.consume("inherit")),"inherit"===o.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),i.readonly=e.consume("readonly"),r&&!i.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),i.base=e.consume("attribute"),i.base)return o.idlType=re(e,"attribute-type")||e.error("Attribute lacks a type"),i.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),i.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),o.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return J(this.tokens.name.value)}*validate(e){switch(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),this.idlType.generic){case"sequence":case"record":{const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield A(this.tokens.name,this,"attr-invalid-type",e);break}default:{const{reference:t}=L(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield A(e,this,"attr-invalid-type",n)}}}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function J(e){return e.startsWith("_")?e.slice(1):e}function X(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const i=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error(`Trailing comma in ${r}`);break}if(s.tokens.separator=e.consume(","),i.push(s),!s.tokens.separator)break}return i}function Q(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function ee({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function te(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new H({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new H({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new H({source:t,tokens:{base:r}}):void 0}function ne(e){return X(e,{parser:V.parse,listName:"arguments list"})}function re(e,t){const n=W.parse(e),r=H.parse(e,t);return r&&(le(r).extAttrs=n),r}function se(e,t){const n=H.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new H({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ie(e){const t=e.consume("stringifier");if(!t)return;return Z.parse(e,{special:t})||K.parse(e,{special:t})||e.error("Unterminated stringifier")}function oe(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function ae(e){return()=>{if(e.extAttrs.length){const t=new be("Exposed=Window,"),n=U.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=` ${r.tokens.name.trivia}`),e.extAttrs.unshift(n)}else{le(e).extAttrs=W.parse(new be("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${oe(t)}`}}}function ce(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return ce(e.idlType);return Object.values(e.tokens).sort(((e,t)=>e.index-t.index))[0]}function le(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?le(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}})}const ue={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},de=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float32Array","Float64Array","any","object","symbol"],pe=["ByteString","DOMString","USVString"],fe=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],he=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(fe,pe,de),me=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],ge=["_constructor","toString","_toString"];class be{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,i=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=o("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=o("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;s+=(e.match(/\n/g)||[]).length,r+=e,i-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=o("decimal"),-1===c&&(c=o("integer")),-1===c){c=o("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(ge.includes(n.value)){const r=`${J(n.value)} is a reserved identifier and must not be used.`;throw new ye(E(t,e,null,r))}he.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=o("string"));for(const o of me)if(e.startsWith(o,n)){t.push({type:"inline",value:o,trivia:r,line:s,index:i}),r="",n+=o.length,c=n;break}if(-1===c&&(c=o("other")),-1===c)throw new Error("Token stream not progressing");n=c,i+=1}return t.push({type:"eof",value:"",trivia:r,line:s,index:i}),t;function o(o,{noFlushTrivia:a}={}){const c=ue[o];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:o,value:l[0],trivia:r,line:s,index:i}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new ye(E(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class ye extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:i,tokens:o}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=i,this.tokens=o}}class we extends D{static parse(e){const t=e.consumeKind("string");if(t)return new we({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class ve extends T{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=le(new ve({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=X(e,{parser:we.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return J(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class $e extends T{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new $e({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return J(this.tokens.target.value)}get includes(){return J(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class ke extends T{static parse(e){const t={},n=le(new ke({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=re(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return J(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class xe extends T{static parse(e,t){const n={base:t},r=le(new xe({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=se(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=ne(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return J(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map((t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class _e extends T{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:i}=t;for(s.name=e.consumeKind("identifier")||e.error(`Missing name in ${i}`),e.current=t,t=le(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error(`Bodyless ${i}`),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error(`Missing semicolon after ${i}`),t.this;const n=W.parse(e);let o;for(const[t,...n]of r)if(o=le(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=n,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return J(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?J(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Ce extends T{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=te(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new H({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=Q(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Ce({source:e.source,tokens:t});return le(r).idlType=n,r}get type(){return"const"}get name(){return J(this.tokens.name.value)}get value(){return ee(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class Se extends T{static parse(e){const t=e.position,n=le(new Se({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:s}=n,i="maplike"===s,o=i||"iterable"===s,a=n.async&&"iterable"===s;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=re(e)||e.error(`Missing a type argument in ${s} declaration`);return n.idlType=[c],n.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(re(e)):i&&e.error(`Missing second type argument in ${s} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...ne(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),n.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class Re extends T{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=ne(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new Re({source:e.source,tokens:n});return le(s).arguments=r,s}get type(){return"constructor"}*validate(e){for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function Ee(e){const t=e.consume("static");if(!t)return;return Z.parse(e,{special:t})||K.parse(e,{special:t})||e.error("No body in static member")}class Ae extends _e{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return _e.parse(e,new Ae({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[Ce.parse],[Re.parse],[Ee],[ie],[Se.parse],[Z.parse],[K.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield A(this.tokens.name,this,"require-exposed",e,{autofix:ae(this)})}const t=this.extAttrs.filter((e=>"Constructor"===e.name));for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield A(e.tokens.name,this,"constructor-member",t,{autofix:Te(this,e)})}if(this.extAttrs.some((e=>"Global"===e.name))){const e=this.extAttrs.filter((e=>"LegacyFactoryFunction"===e.name));for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield A(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter((e=>"constructor"===e.type));for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield A(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=o(e);return{statics:new Set(t.filter((e=>"static"===e.special)).map((e=>e.name))),nonstatics:new Set(t.filter((e=>"static"!==e.special)).map((e=>e.name)))}}(t),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=o(e),s=r.filter((e=>"static"===e.special)),a=r.filter((e=>"static"!==e.special));yield*i(s,n.statics,e,t),yield*i(a,n.nonstatics,e,t),s.forEach((e=>n.statics.add(e.name))),a.forEach((e=>n.nonstatics.add(e.name)))}function*i(e,t,n,r){for(const s of e){const{name:e}=s;if(e&&t.has(e)){const t=`The ${"static"===s.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield A(s.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter((({type:e})=>"operation"===e))}}(e,this))}}function Te(e,t){return e=le(e),()=>{const n=oe(e.extAttrs.tokens.open.trivia),r=e.members.length?oe(ce(e.members[0]).trivia):function(e){const t=oe(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=Re.parse(new be(`\n${r}constructor();`));s.extAttrs=new W({source:e.source,tokens:{}}),le(s).arguments=t.arguments;const i=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,(e=>"constructor"===e.type));e.members.splice(i+1,0,s);const{close:o}=e.tokens;o.trivia.includes("\n")||(o.trivia+=`\n${n}`);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class Le extends _e{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return _e.parse(e,new Le({source:e.source,tokens:r}),{allowedMembers:[[Ce.parse],[ie],[Z.parse,{noInherit:!0}],[K.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Pe extends T{static parse(e){const t={},n=le(new Pe({source:e.source,tokens:t}));return n.extAttrs=W.parse(e),t.required=e.consume("required"),n.idlType=re(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=G.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return J(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class Ie extends _e{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return _e.parse(e,new Ie({source:e.source,tokens:n}),{inheritable:!t,allowedMembers:[[Pe.parse]]})}get type(){return"dictionary"}}class De extends _e{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return _e.parse(e,new De({source:e.source,tokens:n}),{allowedMembers:[[Z.parse,{noInherit:!0,readonly:!0}],[Ce.parse],[K.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield A(this.tokens.name,this,"require-exposed",e,{autofix:ae(this)})}yield*super.validate(e)}}class Ne extends _e{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return _e.parse(e,new Ne({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[Ce.parse],[K.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Oe(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function i(t){const n=s("interface");if(!n)return;return Le.parse(e,n,t)||Ae.parse(e,n,t)||r("Interface has no proper body")}function o(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const t=s("callback");if(t)return e.probe("interface")?Ne.parse(e,t):xe.parse(e,t)}()||i()||function(){const t=s("partial");if(t)return Ie.parse(e,{partial:t})||i({partial:t})||De.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Ie.parse(e)||ve.parse(e)||ke.parse(e)||$e.parse(e)||De.parse(e)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=W.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}le(n).extAttrs=t,s.push(n)}const i=N.parse(e);return t.concrete&&s.push(i),s}();return e.position<n.length&&r("Unrecognised tokens"),a}function je(e){return e}const ze={wrap:e=>e.join(""),trivia:je,name:je,reference:je,type:je,generic:je,nameless:je,inheritance:je,definition:je,extendedAttribute:je,extendedAttributeReference:je};class Me{constructor(e){this.ts=Object.assign({},ze,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=je,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function qe(e,t){const n=new Map,r=e.filter((e=>"includes"===e.type));for(const e of r){const r=t.get(e.includes);if(!r)continue;const s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Ue(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:qe(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield A(n.tokens.name,n,"no-duplicate",r)}}(t)}var We=Object.freeze({__proto__:null,WebIDLParseError:ye,parse:function(e,t={}){const n=new be(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Oe(n,t)},validate:function(e){return[...Ue((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=ze}={}){t=Object.assign({},ze,t);const n=new Me(t);return t.wrap(e.map((e=>e.write(n))))}});const Fe=/^[!#$%&'*+-.^`|~\w]+$/,Be=/[\u000A\u000D\u0009\u0020]/u,He=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function Ge(e,t,n){(t&&""!==t&&!e.has(t)&&He.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function Ve(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ye={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Ke=/[&<>"']/,Ze=new RegExp(Ke.source,"g"),Je=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Xe=new RegExp(Je.source,"g"),Qe={"&":"&","<":"<",">":">",'"':""","'":"'"},et=e=>Qe[e];function tt(e,t){if(t){if(Ke.test(e))return e.replace(Ze,et)}else if(Je.test(e))return e.replace(Xe,et);return e}const nt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function rt(e){return e.replace(nt,((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 st=/(^|[^\[])\^/g;function it(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(st,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const ot=/[^\w:]/g,at=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ct(e,t,n){if(e){let e;try{e=decodeURIComponent(rt(n)).replace(ot,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!at.test(n)&&(n=function(e,t){lt[" "+e]||(ut.test(e)?lt[" "+e]=e+"/":lt[" "+e]=mt(e,"/",!0));const n=-1===(e=lt[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(dt,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(pt,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const lt={},ut=/^[^:]+:\/*[^/]*$/,dt=/^([^:]+:)[\s\S]*$/,pt=/^([^:]+:\/*[^/]*)[\s\S]*$/;const ft={exec:function(){}};function ht(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),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 mt(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function gt(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function bt(e,t,n,r){const s=t.href,i=t.title?tt(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:tt(o)}}class yt{constructor(e){this.options=e||Ye}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:mt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=mt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,s,i,o,a,c,l,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),l=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=l.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=l.slice(i),i+=t[1].length),a=!1,!l&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!s.test(u))&&!o.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(l.search(/[^ ]/)>=4)break;if(s.test(l))break;if(o.test(l))break;if(r.test(l))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),l=u.slice(i)}}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(s="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:s,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(o=0;o<y;o++)if(this.lexer.state.top=!1,g.items[o].tokens=this.lexer.blockTokens(g.items[o].text,[]),!g.loose){const e=g.items[o].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(o=0;o<y;o++)g.items[o].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):tt(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:ht(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,s,i,o=e.align.length;for(n=0;n<o;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(o=e.rows.length,n=0;n<o;n++)e.rows[n]=ht(e.rows[n],e.header.length).map((e=>({text:e})));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],s=0;s<i.length;s++)i[s].tokens=this.lexer.inline(i[s].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:tt(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):tt(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=mt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,s=0;for(;s<n;s++)if("\\"===e[s])s++;else if(e[s]===t[0])r++;else if(e[s]===t[1]&&(r--,r<0))return s;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),bt(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return bt(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const s=r[1]||r[2]||"";if(!s||s&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let s,i,o=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=s.length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);const t=e.slice(0,n+r.index+(r[0].length-s.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const c=t.slice(2,-2);return{type:"strong",raw:t,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=tt(e,!0),{type:"codespan",raw:t[0],text:e}}}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[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=tt(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=tt(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=tt(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=tt(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):tt(n[0]):n[0]:tt(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const wt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\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 *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:ft,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};wt.def=it(wt.def).replace("label",wt._label).replace("title",wt._title).getRegex(),wt.bullet=/(?:[*+-]|\d{1,9}[.)])/,wt.listItemStart=it(/^( *)(bull) */).replace("bull",wt.bullet).getRegex(),wt.list=it(wt.list).replace(/bull/g,wt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+wt.def.source+")").getRegex(),wt._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",wt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,wt.html=it(wt.html,"i").replace("comment",wt._comment).replace("tag",wt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wt.paragraph=it(wt._paragraph).replace("hr",wt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.blockquote=it(wt.blockquote).replace("paragraph",wt.paragraph).getRegex(),wt.normal={...wt},wt.gfm={...wt.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},wt.gfm.table=it(wt.gfm.table).replace("hr",wt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.gfm.paragraph=it(wt._paragraph).replace("hr",wt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",wt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.pedantic={...wt.normal,html:it("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",wt._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+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(wt.normal._paragraph).replace("hr",wt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",wt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const vt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ft,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)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ft,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function $t(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function kt(e){let t,n,r="";const s=e.length;for(t=0;t<s;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}vt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",vt.punctuation=it(vt.punctuation).replace(/punctuation/g,vt._punctuation).getRegex(),vt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,vt.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,vt._comment=it(wt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),vt.emStrong.lDelim=it(vt.emStrong.lDelim).replace(/punct/g,vt._punctuation).getRegex(),vt.emStrong.rDelimAst=it(vt.emStrong.rDelimAst,"g").replace(/punct/g,vt._punctuation).getRegex(),vt.emStrong.rDelimUnd=it(vt.emStrong.rDelimUnd,"g").replace(/punct/g,vt._punctuation).getRegex(),vt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,vt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,vt._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])?)+(?![-_])/,vt.autolink=it(vt.autolink).replace("scheme",vt._scheme).replace("email",vt._email).getRegex(),vt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,vt.tag=it(vt.tag).replace("comment",vt._comment).replace("attribute",vt._attribute).getRegex(),vt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,vt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,vt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,vt.link=it(vt.link).replace("label",vt._label).replace("href",vt._href).replace("title",vt._title).getRegex(),vt.reflink=it(vt.reflink).replace("label",vt._label).replace("ref",wt._label).getRegex(),vt.nolink=it(vt.nolink).replace("ref",wt._label).getRegex(),vt.reflinkSearch=it(vt.reflinkSearch,"g").replace("reflink",vt.reflink).replace("nolink",vt.nolink).getRegex(),vt.normal={...vt},vt.pedantic={...vt.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",vt._label).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vt._label).getRegex()},vt.gfm={...vt.normal,escape:it(vt.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},vt.gfm.url=it(vt.gfm.url,"i").replace("email",vt.gfm._extended_email).getRegex(),vt.breaks={...vt.gfm,br:it(vt.br).replace("{2,}","*").getRegex(),text:it(vt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class xt{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ye,this.options.tokenizer=this.options.tokenizer||new yt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:wt.normal,inline:vt.normal};this.options.pedantic?(t.block=wt.pedantic,t.inline=vt.pedantic):this.options.gfm&&(t.block=wt.gfm,this.options.breaks?t.inline=vt.breaks:t.inline=vt.gfm),this.tokenizer.rules=t}static get rules(){return{block:wt,inline:vt}}static lex(e,t){return new xt(t).lex(e)}static lexInline(e,t){return new xt(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,i,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+gt("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+gt("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index+i[0].length-2)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,kt))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,kt))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s,$t))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}let _t=class{constructor(e){this.options=e||Ye}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+tt(r)+'">'+(n?e:tt(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:tt(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=ct(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=ct(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class Ct{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,n){return""+n}image(e,t,n){return""+n}br(){return""}}class St{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class Rt{constructor(e){this.options=e||Ye,this.options.renderer=this.options.renderer||new _t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ct,this.slugger=new St}static parse(e,t){return new Rt(t).parse(e)}static parseInline(e,t){return new Rt(t).parseInline(e)}parse(e,t=!0){let n,r,s,i,o,a,c,l,u,d,p,f,h,m,g,b,y,w,v,$="";const k=e.length;for(n=0;n<k;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))$+=v||"";else switch(d.type){case"space":continue;case"hr":$+=this.renderer.hr();continue;case"heading":$+=this.renderer.heading(this.parseInline(d.tokens),d.depth,rt(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":$+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(l="",c="",i=d.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(l+=this.renderer.tablerow(c),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],c="",o=a.length,s=0;s<o;s++)c+=this.renderer.tablecell(this.parseInline(a[s].tokens),{header:!1,align:d.align[s]});u+=this.renderer.tablerow(c)}$+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(d.tokens),$+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);$+=this.renderer.list(u,p,f);continue;case"html":$+=this.renderer.html(d.text);continue;case"paragraph":$+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);$+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return $}parseInline(e,t){t=t||this.renderer;let n,r,s,i="";const o=e.length;for(n=0;n<o;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(s=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==s||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=s||"";else switch(r.type){case"escape":case"text":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}class Et{constructor(e){this.options=e||Ye}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function At(e,t){return(n,r,s)=>{"function"==typeof r&&(s=r,r=null);const i={...r},o=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+tt(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...Tt.defaults,...i}).silent,r.async,s);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),s){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return o(e)}const c=function(e){let n;if(!e)try{r.walkTokens&&Tt.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?o(e):s(null,n)};if(!i||i.length<3)return c();if(delete r.highlight,!a.length)return c();let l=0;return Tt.walkTokens(a,(function(e){"code"===e.type&&(l++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return c(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),l--,0===l&&c()}))}),0))})),void(0===l&&c())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(Tt.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(o);try{r.hooks&&(n=r.hooks.preprocess(n));const s=e(n,r);r.walkTokens&&Tt.walkTokens(s,r.walkTokens);let i=t(s,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return o(e)}}}function Tt(e,t,n){return At(xt.lex,Rt.parse)(e,t,n)}Tt.options=Tt.setOptions=function(e){var t;return Tt.defaults={...Tt.defaults,...e},t=Tt.defaults,Ye=t,Tt},Tt.getDefaults=Ve,Tt.defaults=Ye,Tt.use=function(...e){const t=Tt.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=Tt.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=Tt.defaults.renderer||new _t;for(const n in e.renderer){const r=t[n];t[n]=(...s)=>{let i=e.renderer[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.renderer=t}if(e.tokenizer){const t=Tt.defaults.tokenizer||new yt;for(const n in e.tokenizer){const r=t[n];t[n]=(...s)=>{let i=e.tokenizer[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.tokenizer=t}if(e.hooks){const t=Tt.defaults.hooks||new Et;for(const n in e.hooks){const r=t[n];Et.passThroughHooks.has(n)?t[n]=s=>{if(Tt.defaults.async)return Promise.resolve(e.hooks[n].call(t,s)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,s);return r.call(t,i)}:t[n]=(...s)=>{let i=e.hooks[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.hooks=t}if(e.walkTokens){const t=Tt.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}Tt.setOptions(n)}))},Tt.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Tt,r)),r.type){case"table":for(const e of r.header)n=n.concat(Tt.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(Tt.walkTokens(r.tokens,t));break;case"list":n=n.concat(Tt.walkTokens(r.items,t));break;default:Tt.defaults.extensions&&Tt.defaults.extensions.childTokens&&Tt.defaults.extensions.childTokens[r.type]?Tt.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(Tt.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(Tt.walkTokens(r.tokens,t)))}return n},Tt.parseInline=At(xt.lexInline,Rt.parseInline),Tt.Parser=Rt,Tt.parser=Rt.parse,Tt.Renderer=_t,Tt.TextRenderer=Ct,Tt.Lexer=xt,Tt.lexer=xt.lex,Tt.Tokenizer=yt,Tt.Slugger=St,Tt.Hooks=Et,Tt.parse=Tt,Tt.options,Tt.setOptions,Tt.use,Tt.walkTokens,Tt.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Lt,Pt={};Lt={get exports(){return Pt},set exports(e){Pt=e}},function(e,t){Lt.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function o(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function c(e,t){return e.replace(t[0],(function(n,r){var s=a(t[1],arguments);return o(""===n?e[r-1]:n,s)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var i=r[s];if(i[0].test(t))return c(t,i)}return t}function u(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?o(r,s):e.hasOwnProperty(s)?o(r,e[s]):l(s,r,n)}}function d(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&l(s,s,n)===s}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(s,r,e),p.isPlural=d(s,r,e),p.singular=u(r,s,t),p.isSingular=d(r,s,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),s[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var It=Pt,Dt=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=i.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,i){for(var o=("selectedIndex"in t),a=o;r<s;){var c,l=e(n[r],1);t.insertBefore(l,i),o&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function i(e,t){return e==t}function o(e){return e}function a(e,t,n,r,s,i,o){var a=i-s;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=s;c<n&&l<i&&o(e[c],r[l]);)c++,l++;if(l===i)return t;t=c+1}return-1}function c(e,t,n,r,s){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,s=t;r<s;){var i=(r+s)/2>>>0;n<e[i]?s=i:r=1+i}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||o,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return s(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var $=m-g,k=b-y,x=-1;if($<k){if(-1<(x=a(n,y,b,t,g,m,u)))return s(d,e,n,y,x,d(t[g],0)),s(d,e,n,x+$,b,c(d,t,m,h,f)),n}else if(k<$&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+k,m),n;return $<2||k<2?(s(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):$==k&&function(e,t,n,r,s,i){for(;r<s&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?s(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,i,o,a,c,u,d,f,h,m){!function(e,t,n,r,i,o,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:i++,f++;break;case 1:d.push(r[i]),s(t,n,r,i++,i,f<c?t(o[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(o[a])?a++:l(t,o,a++,a)}}(function(e,t,n,r,s,i,o){var a,c,l,u,d,p,f=n+i,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<i&&c<n&&o(r[s+l],e[t+c]);)l++,c++;if(l===i&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&o(r[s+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,o,a,c,d,h)||function(e,t,n,r,s,i,o,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=o;for(var h=s.slice(i,o),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+i))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--o;d[c]>o;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,$=w.oldi;v<n;)y[--l]=1,--n;for(;$<o;)y[--l]=-1,--o;y[--l]=0,--n,--o,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;i<=o;)y[--l]=-1,--o;return y}(n,r,i,o,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,k,t,g,m,$,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(s){var i=r(s);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,s){e.call(r,n[s],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(s,i){return n[r(s)?e:t.push(s)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function $(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,_,C,S,R,E,A={},T={},L=[],P=T.hasOwnProperty,I=0,D={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(I=L.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<I;n++){var r=L[n];if(P.call(e,r))return T[r](e[r],t)}}},N=Array.isArray||(_=(x={}.toString).call([]),function(e){return x.call(e)===_}),O=(C=e,S="fragment",E="content"in z(R="template")?function(e){var t=z(R);return t.innerHTML=e,t.content}:function(e){var t,n=z(S),r=z(R);return j(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(S),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",j(t,n.firstChild.childNodes),t}:E)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===S?C.createDocumentFragment():C.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,U,W,F,B,H,G,V,Y=(q="appendChild",U="cloneNode",W="createTextNode",B=(F="importNode")in(M=e),(H=M.createDocumentFragment())[q](M[W]("g")),H[q](M[W]("")),(B?M[F](H,!0):H[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),s=t.childNodes||[],i=s.length,o=0;n&&o<i;o++)r[q](e(s[o],n));return r}:B?M[F]:function(e,t){return e[U](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Z="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Z+'"></p>',G.content.childNodes[0].getAttribute(V)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Z+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,se="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",oe=new RegExp(se+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(se+re+ie+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,ue)+r}function ue(e,t,n){return t+(n||'"')+Z+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,s){for(var i=t.childNodes,o=i.length,a=0;a<o;){var c=i[a];switch(c.nodeType){case 1:var l=s.concat(a);!function(t,n,r,s){for(var i,o=t.attributes,a=[],c=[],l=pe(o,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Z;if(f||1<(i=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=o[m]||o[m.toLowerCase()];if(f)n.push(he(g,s,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(he(g,s,m,i))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var $=e.createElement(v);for(u=o.length,d=0;d<u;)$.setAttributeNode(o[d++].cloneNode(!0));$.textContent=t.textContent,t.parentNode.replaceChild($,t)}}(c,n,r,l),fe(c,n,r,l);break;case 8:var u=c.textContent;if(u===Z)r.shift(),n.push(Q.test(t.nodeName)?me(t,s):{type:"any",node:c,path:s.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(c),a--,o--}break;case 3:Q.test(t.nodeName)&&K.call(c.textContent)===X&&(r.shift(),n.push(me(t,s)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(oe,le)})(t),r=e.transform;r&&(n=r(n));var s=O(n,e.type);ve(s);var i=[];return fe(s,i,t.slice(0),[]),{content:s,updates:function(n){for(var r=[],s=i.length,o=0,a=0;o<s;){var c=i[o++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var i=1,o=1;i<e;){var a=r[i-o];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(o+=d-2;u<d;)l+=arguments[i++]+c[u++];a.fn(l)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var $e,ke,xe=($e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Ce(n,!0)}(e,t):Ce(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Ce(e,t){var n,r;return function(s){var i,o,a,c;switch(typeof s){case"object":if(s){if("object"===n){if(!t&&r!==s)for(o in r)o in s||(e[o]="")}else t?e.value="":e.cssText="";for(o in i=t?{}:e,s)a="number"!=typeof(c=s[o])||$e.test(o)?c:c+"px",!t&&/^--/.test(o)?i.setProperty(o,a):i[o]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=i):r=s;break}default:r!=s&&(n="string",r=s,t?e.value=s||"":e.cssText=s||"")}}}var Se,Re,Ee=(Se=[].slice,(Re=Ae.prototype).ELEMENT_NODE=1,Re.nodeType=111,Re.remove=function(e){var t,n=this.childNodes,r=this.firstChild,s=this.lastChild;return this._=null,e&&2===n.length?s.parentNode.removeChild(s):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(s),t.deleteContents()),r},Re.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,i=r.length;s<i;s++)t.appendChild(r[s]);return t},Ae);function Ae(e){var t=this.childNodes=Se.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Ue:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return Le(e.render(),t);default:return e}}function Pe(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Te).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Ie(e){return null!=e&&"then"in e}var De,Ne,Oe,je,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,Ue=Ee.prototype.nodeType,We=(Ne=(De={Event:b,WeakSet:u}).Event,Oe=De.WeakSet,je=!0,ze=null,function(e){return je&&(je=!je,ze=new Oe,function(e){var t=new Oe,n=new Oe;try{new MutationObserver(o).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,s=[],i=function(e){s.push(e),clearTimeout(r),r=setTimeout((function(){o(s.splice(r=0,s.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function o(e){for(var r,s=e.length,i=0;i<s;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var s,i=new Ne(t),o=e.length,a=0;a<o;1===(s=e[a++]).nodeType&&function e(t,n,r,s,i){ze.has(t)&&!s.has(t)&&(i.delete(t),s.add(t),t.dispatchEvent(n));for(var o=t.children||[],a=o.length,c=0;c<a;e(o[c++],n,r,s,i));}(s,i,t,n,r));}}(e.ownerDocument)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Be=[].slice;function He(t){return this.type=t,function(t){var n=we,r=ve;return function(s){var i,o,a;return n!==s&&(i=t,o=n=s,a=be.get(o)||be.set(o,ye(i,o)),r=a.updates(Y.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,s=Me in e;if("style"===t)return xe(e,n,s);if("."===t.slice(0,1))return l=e,u=t.slice(1),s?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return o=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(a,""):o.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?We(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!s&&t in e&&!Fe.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var s=D.attributes[t](e,n);r!==s&&(null==(r=s)?e.removeAttribute(t):e.setAttribute(t,s))};var o,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Le,before:e},s=Me in e?"svg":"html",i=!1;return function o(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":o(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=h(e.parentNode,t,[],r);break}default:if(i=!1,N(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":o({html:a});break;case"object":if(N(a[0])&&(a=a.concat.apply([],a)),Ie(a[0])){Promise.all(a).then(o);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Be.call(a.childNodes):[a],r):Ie(a)?a.then(o):"placeholder"in a?Pe(a,o):"text"in a?o(String(a.text)):"any"in a?o(a.any):"html"in a?t=h(e.parentNode,t,Be.call(O([].concat(a.html).join(""),s).childNodes),r):o("length"in a?Be.call(a):D.invoke(a,o))}var c}},text:function(e){var t;return function n(r){var s;t!==r&&("object"==(s=typeof(t=r))&&r?Ie(r)?r.then(n):"placeholder"in r?Pe(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Be.call(r).join(""):D.invoke(r,n)):"function"==s?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,s,i,o,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(s={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return s[t]||(s[t]=e)},Ve=c?i:(o=new n,function(e){return o.get(e)||(n=i(t=e),o.set(t,n),n);var t,n})):Ge=!0,Ye(t)};function Ye(e){return Ge?e:Ve(e)}function Ke(e){for(var t=arguments.length,n=[Ye(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ze=new n,Je=function(e){var t,n,r;return function(){var s=Ke.apply(null,arguments);return r!==s[0]?(r=s[0],n=new He(e),t=Qe(n.apply(n,s))):n.apply(n,s),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Ze.get(e),s=t;return-1<n&&(s=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ze.set(e,r={}),r[s]||(r[s]=Je(t))},Qe=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ee(t):e},et=new n;function tt(){var e=et.get(this),t=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(Me in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,st,it,ot=D.define,at=He.prototype;function ct(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?ct.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?ct.bind(e):Xe(e,"html"):("raw"in e?Je("html"):ct.wire).apply(null,arguments)}return ct.Component=v,ct.bind=function(e){return tt.bind(e)},ct.define=ot,ct.diff=h,(ct.hyper=ct).observe=We,ct.tagger=at,ct.wire=function(e,t){return null==e?Je(t||"html"):Xe(e,t||"html")},ct._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,st=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,s){var i,o,a,c=t.get(e)||it(e,t);switch(typeof s){case"object":case"function":var l=c.w||(c.w=new n);return l.get(s)||(i=l,o=s,a=new e(r),i.set(o,a),a);default:var u=c.p||(c.p=st(null));return u[s]||(u[s]=new e(r))}}(this,rt.get(e)||(r=e,s=new w,rt.set(r,s),s),e,null==t?"default":t);var r,s}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:$("html",nt),svg:$("svg",nt),state:$("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var s in r)n[s]=r[s];return!1!==t&&this.render(),this}}}),ct}(document); +/*! (c) Andrea Giammarchi (ISC) */const Nt=Dt,Ot=S,jt=Tt,zt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",s=null,i=new Map,o="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(o){case"type":if("/"===c){o="subtype";continue}t+=c;break;case"subtype":if(";"===c){o="param-start";continue}n+=c;break;case"param-start":if(Be.test(c)||";"===c)continue;r+=c,o="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){o="param-value",s=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){o="collect-quoted-string";continue}if(";"===c){s=s.trimEnd(),o="param-start",Ge(i,r,s),r="";continue}s="string"==typeof s?s+c:c;break;case"collect-quoted-string":if('"'===c){Ge(i,r,s),o="ignore-input-until-next-param",r="",s=null;continue}if("\\"===c)continue;s="string"==typeof s?s+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;o="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${o} `)}}r&&Ge(i,r,s);if(""===t.trim()||!Fe.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!Fe.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(i.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?Fe.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Mt=It,qt=We;function Ut(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Wt=Object.freeze({__proto__:null,name:"core/reindent",reindent:Ut,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Ut(e.innerHTML)}});const Ft=/-/g;const Bt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ht="en"===c||c.startsWith("en-")?"en-AU":c,Gt=new Intl.DateTimeFormat(Ht,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ht?"2-digit":"numeric"}),Vt=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function Yt(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Kt(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Zt(e,t="long"){const n=new Intl.ListFormat(c,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s))}}const Jt=Zt("conjunction"),Xt=Zt("disjunction");function Qt(e,t){return Jt(e,t).join("")}function en(e,t){return Xt(e,t).join("")}function tn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}function nn(e){return e.trim().replace(/\s+/g," ")}function rn(e,t=c){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=sn(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function sn(e,t,n=c){return e[n=n.toLowerCase()]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}function on(e,t=""){return Bt.format(e).replace(Ft,t)}function an(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Rn(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}async function cn(e,t=864e5){const n=new Request(e),r=new URL(n.url);let s,i;if("caches"in window)try{if(s=await caches.open(r.origin),i=await s.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const o=await fetch(n);if(!o.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(s&&o.ok){const e=o.clone(),r=new Headers(o.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return o}function ln(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Nt`${e}, `));return Nt`${r}${n[n.length-1]}`}function un(e,t){return[].concat(Jt(e,t)).map((e=>"string"==typeof e?Nt`${e}`:e))}function dn(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(nn(e.textContent));return pn(e,t,n)}function pn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s=`x${s}`):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function fn(e){const t=new Set,n="ltNodefault"in e.dataset?"":nn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>nn(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(nn(e))))}return[...t]}function hn(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function mn(e,t){const n=t.closest(Vt);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function gn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function bn(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function yn(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function wn(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class vn extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function $n(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{hn(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),kn(t),t}function kn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...xn(t)])e.remove()}function*xn(e){for(;e.nextNode();)yield e.currentNode}class _n extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Cn extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||pn(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:i,title:o,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:i,title:o,details:a,stack:n}}}function Sn(e,t,n={}){const s={...n,isWarning:!1};r("error",new Cn(e,t,s))}function Rn(e,t,n={}){const s={...n,isWarning:!0};r("warn",new Cn(e,t,s))}function En(e){return e?`\`${e}\``:""}function An(e,{quotes:t}={quotes:!1}){return en(e,t?e=>En(Ln(e)):En)}function Tn(e,{quotes:t}={quotes:!1}){return Qt(e,t?e=>En(Ln(e)):En)}function Ln(e){return String(e)?`"${e}"`:""}function Pn(e,...t){return Ut(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,i]=r.slice(1,-1).split("|");if(i){return`${e}[${s}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`})).join(""))}const In=new Map([["text/html","html"],["application/xml","xml"]]);function Dn(e,t=document){const n=In.get(e);if(!n){const t=[...In.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Nn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Nn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:s}=e;kn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Kt(s);const i=e.createDocumentFragment(),o=e.querySelector("meta[name='viewport']");o&&t.firstChild!==o&&i.appendChild(o);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=Nt`<meta charset="utf-8" />`);i.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Nt` <meta name="generator" content="${c}" /> `;i.appendChild(l),t.prepend(i),r("beforesave",s)}(n);let s="";if("xml"===e)s=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(s+=(new XMLSerializer).serializeToString(n.doctype)),s+=n.documentElement.outerHTML;return s}t("core/exporter",{rsDocToDataURL:Dn});class On{constructor(){this._respecDonePromise=new Promise((e=>{s("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],s("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),s("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Nn("html",document)}}const jn="core/post-process";const zn="core/pre-process";const Mn="core/base-runner";async function qn(e){!function(){const e=new On;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),s("amend-user-config",n),s("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let s;try{s=JSON.parse(r)}catch{s=r}return[n,s]})),s=Object.fromEntries(n);Object.assign(e,s),r("amend-user-config",s)}(respecConfig),performance.mark(`${Mn}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Sn("Every item in `preProcess` must be a JS function.",zn),t})).map((async t=>{try{return await t(e,document)}catch(e){Sn(`Function ${t.name} threw an error during \`preProcess\`.`,zn,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),respecConfig.state={},await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,s)=>{const i=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),s(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){s(e)}finally{clearTimeout(i),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},r("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Sn("Every item in `postProcess` must be a JS function.",jn),t})).map((async t=>{try{return await t(e,document)}catch(e){Sn(`Function ${t.name} threw an error during \`postProcess\`.`,jn,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Kt(document),performance.mark(`${Mn}-end`),performance.measure(Mn,`${Mn}-start`,`${Mn}-end`)}var Un=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} @@ -747,7 +747,7 @@ dd{margin-left:0} } @media print{ .removeOnSave{display:none} -}`;const ps=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=ds,document.head.appendChild(e),e}();var fs=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&ps.remove()}});function hs(){const e=Nt`<script src="https://www.w3.org/scripts/TR/2021/fixup.js">`;location.hash&&e.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),document.body.appendChild(e)}const ms=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/base.css",as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image"}],t=document.createDocumentFragment();for(const n of e.map(Yt))t.appendChild(n);return t}();ms.appendChild(Nt`<link +}`;const ps=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=ds,document.head.appendChild(e),e}();var fs=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&ps.remove()}});function hs(){const e=Nt`<script src="https://www.w3.org/scripts/TR/2021/fixup.js">`;location.hash&&e.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),document.body.appendChild(e)}const ms=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/base.css",as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image",corsMode:"anonymous"}],t=document.createDocumentFragment();for(const n of e.map(Yt))t.appendChild(n);return t}();ms.appendChild(Nt`<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2021/base.css" class="removeOnSave" diff --git a/builds/respec-w3c.js.map b/builds/respec-w3c.js.map index ccc6b84b24..fb7346a2a3 100644 --- a/builds/respec-w3c.js.map +++ b/builds/respec-w3c.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-w3c.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../node_modules/webidl2/lib/error.js","../node_modules/webidl2/lib/productions/base.js","../node_modules/webidl2/lib/validators/helpers.js","../node_modules/webidl2/lib/productions/array-base.js","../node_modules/webidl2/lib/productions/token.js","../node_modules/webidl2/lib/productions/extended-attributes.js","../node_modules/webidl2/lib/productions/type.js","../node_modules/webidl2/lib/productions/default.js","../node_modules/webidl2/lib/productions/argument.js","../node_modules/webidl2/lib/productions/operation.js","../node_modules/webidl2/lib/productions/attribute.js","../node_modules/webidl2/lib/productions/helpers.js","../node_modules/webidl2/lib/tokeniser.js","../node_modules/webidl2/lib/productions/enum.js","../node_modules/webidl2/lib/productions/includes.js","../node_modules/webidl2/lib/productions/typedef.js","../node_modules/webidl2/lib/productions/callback.js","../node_modules/webidl2/lib/productions/container.js","../node_modules/webidl2/lib/productions/constant.js","../node_modules/webidl2/lib/productions/iterable.js","../node_modules/webidl2/lib/productions/constructor.js","../node_modules/webidl2/lib/productions/interface.js","../node_modules/webidl2/lib/validators/interface.js","../node_modules/webidl2/lib/productions/mixin.js","../node_modules/webidl2/lib/productions/field.js","../node_modules/webidl2/lib/productions/dictionary.js","../node_modules/webidl2/lib/productions/namespace.js","../node_modules/webidl2/lib/productions/callback-interface.js","../node_modules/webidl2/lib/webidl2.js","../node_modules/webidl2/lib/writer.js","../node_modules/webidl2/lib/validator.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/reindent.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/w3c.js","../src/core/location-hash.js","../src/w3c/group.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/w3c/templates/headers.js","../src/w3c/templates/cgbg-headers.js","../src/w3c/templates/sotd.js","../src/w3c/templates/cgbg-sotd.js","../src/w3c/headers.js","../src/core/defaults.js","../src/w3c/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/w3c/style.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/w3c/level.js","../src/w3c/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/w3c/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/tables.js","../src/core/dfn-finder.js","../src/core/webidl-clipboard.js","../src/styles/webidl.css.js","../src/core/webidl.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/xref-db.js","../src/core/xref.js","../src/styles/dfn-index.css.js","../src/core/dfn-index.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/webidl-index.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/styles/caniuse.css.js","../src/core/caniuse.js","../src/styles/mdn-annotation.css.js","../src/core/mdn-annotation.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/search-xref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/w3c/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/web-monetization.js","../src/core/before-save.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/check-internal-slots.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-captionless-tables.js","../src/core/linter-rules/no-unused-dfns.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/w3c/linter-rules/required-sections.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.js","../src/core/linter-rules/informative-dfn.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * @param {string} text\n */\nfunction lastLine(text) {\n const splitted = text.split(\"\\n\");\n return splitted[splitted.length - 1];\n}\n\nfunction appendIfExist(base, target) {\n let result = base;\n if (target) {\n result += ` ${target}`;\n }\n return result;\n}\n\nfunction contextAsText(node) {\n const hierarchy = [node];\n while (node && node.parent) {\n const { parent } = node;\n hierarchy.unshift(parent);\n node = parent;\n }\n return hierarchy.map((n) => appendIfExist(n.type, n.name)).join(\" -> \");\n}\n\n/**\n * @typedef {object} WebIDL2ErrorOptions\n * @property {\"error\" | \"warning\"} [level]\n * @property {Function} [autofix]\n * @property {string} [ruleName]\n *\n * @typedef {ReturnType<typeof error>} WebIDLErrorData\n *\n * @param {string} message error message\n * @param {*} position\n * @param {*} current\n * @param {*} message\n * @param {\"Syntax\" | \"Validation\"} kind error type\n * @param {WebIDL2ErrorOptions=} options\n */\nfunction error(\n source,\n position,\n current,\n message,\n kind,\n { level = \"error\", autofix, ruleName } = {}\n) {\n /**\n * @param {number} count\n */\n function sliceTokens(count) {\n return count > 0\n ? source.slice(position, position + count)\n : source.slice(Math.max(position + count, 0), position);\n }\n\n /**\n * @param {import(\"./tokeniser.js\").Token[]} inputs\n * @param {object} [options]\n * @param {boolean} [options.precedes]\n * @returns\n */\n function tokensToText(inputs, { precedes } = {}) {\n const text = inputs.map((t) => t.trivia + t.value).join(\"\");\n const nextToken = source[position];\n if (nextToken.type === \"eof\") {\n return text;\n }\n if (precedes) {\n return text + nextToken.trivia;\n }\n return text.slice(nextToken.trivia.length);\n }\n\n const maxTokens = 5; // arbitrary but works well enough\n const line =\n source[position].type !== \"eof\"\n ? source[position].line\n : source.length > 1\n ? source[position - 1].line\n : 1;\n\n const precedingLastLine = lastLine(\n tokensToText(sliceTokens(-maxTokens), { precedes: true })\n );\n\n const subsequentTokens = sliceTokens(maxTokens);\n const subsequentText = tokensToText(subsequentTokens);\n const subsequentFirstLine = subsequentText.split(\"\\n\")[0];\n\n const spaced = \" \".repeat(precedingLastLine.length) + \"^\";\n const sourceContext = precedingLastLine + subsequentFirstLine + \"\\n\" + spaced;\n\n const contextType = kind === \"Syntax\" ? \"since\" : \"inside\";\n const inSourceName = source.name ? ` in ${source.name}` : \"\";\n const grammaticalContext =\n current && current.name\n ? `, ${contextType} \\`${current.partial ? \"partial \" : \"\"}${contextAsText(\n current\n )}\\``\n : \"\";\n const context = `${kind} error at line ${line}${inSourceName}${grammaticalContext}:\\n${sourceContext}`;\n return {\n message: `${context} ${message}`,\n bareMessage: message,\n context,\n line,\n sourceName: source.name,\n level,\n ruleName,\n autofix,\n input: subsequentText,\n tokens: subsequentTokens,\n };\n}\n\n/**\n * @param {string} message error message\n */\nexport function syntaxError(source, position, current, message) {\n return error(source, position, current, message, \"Syntax\");\n}\n\n/**\n * @param {string} message error message\n * @param {WebIDL2ErrorOptions} [options]\n */\nexport function validationError(\n token,\n current,\n ruleName,\n message,\n options = {}\n) {\n options.ruleName = ruleName;\n return error(\n current.source,\n token.index,\n current,\n message,\n \"Validation\",\n options\n );\n}\n","export class Base {\n /**\n * @param {object} initializer\n * @param {Base[\"source\"]} initializer.source\n * @param {Base[\"tokens\"]} initializer.tokens\n */\n constructor({ source, tokens }) {\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens, writable: true },\n parent: { value: null, writable: true },\n this: { value: this }, // useful when escaping from proxy\n });\n }\n\n toJSON() {\n const json = { type: undefined, name: undefined, inheritance: undefined };\n let proto = this;\n while (proto !== Object.prototype) {\n const descMap = Object.getOwnPropertyDescriptors(proto);\n for (const [key, value] of Object.entries(descMap)) {\n if (value.enumerable || value.get) {\n // @ts-ignore - allow indexing here\n json[key] = this[key];\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return json;\n }\n}\n","/**\n * @typedef {import(\"../productions/dictionary.js\").Dictionary} Dictionary\n *\n * @param {*} idlType\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {object} [options]\n * @param {boolean} [options.useNullableInner] use when the input idlType is nullable and you want to use its inner type\n * @return {{ reference: *, dictionary: Dictionary }} the type reference that ultimately includes dictionary.\n */\nexport function idlTypeIncludesDictionary(\n idlType,\n defs,\n { useNullableInner } = {}\n) {\n if (!idlType.union) {\n const def = defs.unique.get(idlType.idlType);\n if (!def) {\n return;\n }\n if (def.type === \"typedef\") {\n const { typedefIncludesDictionary } = defs.cache;\n if (typedefIncludesDictionary.has(def)) {\n // Note that this also halts when it met indeterminate state\n // to prevent infinite recursion\n return typedefIncludesDictionary.get(def);\n }\n defs.cache.typedefIncludesDictionary.set(def, undefined); // indeterminate state\n const result = idlTypeIncludesDictionary(def.idlType, defs);\n defs.cache.typedefIncludesDictionary.set(def, result);\n if (result) {\n return {\n reference: idlType,\n dictionary: result.dictionary,\n };\n }\n }\n if (def.type === \"dictionary\" && (useNullableInner || !idlType.nullable)) {\n return {\n reference: idlType,\n dictionary: def,\n };\n }\n }\n for (const subtype of idlType.subtype) {\n const result = idlTypeIncludesDictionary(subtype, defs);\n if (result) {\n if (subtype.union) {\n return result;\n }\n return {\n reference: subtype,\n dictionary: result.dictionary,\n };\n }\n }\n}\n\n/**\n * @param {*} dict dictionary type\n * @param {import(\"../validator.js\").Definitions} defs\n * @return {boolean}\n */\nexport function dictionaryIncludesRequiredField(dict, defs) {\n if (defs.cache.dictionaryIncludesRequiredField.has(dict)) {\n return defs.cache.dictionaryIncludesRequiredField.get(dict);\n }\n // Set cached result to indeterminate to short-circuit circular definitions.\n // The final result will be updated to true or false.\n defs.cache.dictionaryIncludesRequiredField.set(dict, undefined);\n let result = dict.members.some((field) => field.required);\n if (!result && dict.inheritance) {\n const superdict = defs.unique.get(dict.inheritance);\n if (!superdict) {\n // Assume required members in the supertype if it is unknown.\n result = true;\n } else if (dictionaryIncludesRequiredField(superdict, defs)) {\n result = true;\n }\n }\n defs.cache.dictionaryIncludesRequiredField.set(dict, result);\n return result;\n}\n","export class ArrayBase extends Array {\n constructor({ source, tokens }) {\n super();\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens },\n parent: { value: null, writable: true },\n });\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class WrappedToken extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\n static parser(tokeniser, type) {\n return () => {\n const value = tokeniser.consumeKind(type);\n if (value) {\n return new WrappedToken({\n source: tokeniser.source,\n tokens: { value },\n });\n }\n };\n }\n\n get value() {\n return unescape(this.tokens.value.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.value),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Eof extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"eof\");\n if (value) {\n return new Eof({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"eof\";\n }\n}\n","import { Base } from \"./base.js\";\nimport { ArrayBase } from \"./array-base.js\";\nimport { WrappedToken } from \"./token.js\";\nimport { list, argument_list, autoParenter, unescape } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} tokenName\n */\nfunction tokens(tokeniser, tokenName) {\n return list(tokeniser, {\n parser: WrappedToken.parser(tokeniser, tokenName),\n listName: tokenName + \" list\",\n });\n}\n\nconst extAttrValueSyntax = [\"identifier\", \"decimal\", \"integer\", \"string\"];\n\nconst shouldBeLegacyPrefixed = [\n \"NoInterfaceObject\",\n \"LenientSetter\",\n \"LenientThis\",\n \"TreatNonObjectAsNull\",\n \"Unforgeable\",\n];\n\nconst renamedLegacies = new Map([\n .../** @type {[string, string][]} */ (\n shouldBeLegacyPrefixed.map((name) => [name, `Legacy${name}`])\n ),\n [\"NamedConstructor\", \"LegacyFactoryFunction\"],\n [\"OverrideBuiltins\", \"LegacyOverrideBuiltIns\"],\n [\"TreatNullAs\", \"LegacyNullToEmptyString\"],\n]);\n\n/**\n * This will allow a set of extended attribute values to be parsed.\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction extAttrListItems(tokeniser) {\n for (const syntax of extAttrValueSyntax) {\n const toks = tokens(tokeniser, syntax);\n if (toks.length) {\n return toks;\n }\n }\n tokeniser.error(\n `Expected identifiers, strings, decimals, or integers but none found`\n );\n}\n\nexport class ExtendedAttributeParameters extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = { assign: tokeniser.consume(\"=\") };\n const ret = autoParenter(\n new ExtendedAttributeParameters({ source: tokeniser.source, tokens })\n );\n ret.list = [];\n if (tokens.assign) {\n tokens.asterisk = tokeniser.consume(\"*\");\n if (tokens.asterisk) {\n return ret.this;\n }\n tokens.secondaryName = tokeniser.consumeKind(...extAttrValueSyntax);\n }\n tokens.open = tokeniser.consume(\"(\");\n if (tokens.open) {\n ret.list = ret.rhsIsList\n ? // [Exposed=(Window,Worker)]\n extAttrListItems(tokeniser)\n : // [LegacyFactoryFunction=Audio(DOMString src)] or [Constructor(DOMString str)]\n argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unexpected token in extended attribute argument list\");\n } else if (tokens.assign && !tokens.secondaryName) {\n tokeniser.error(\"No right hand side to extended attribute assignment\");\n }\n return ret.this;\n }\n\n get rhsIsList() {\n return (\n this.tokens.assign && !this.tokens.asterisk && !this.tokens.secondaryName\n );\n }\n\n get rhsType() {\n if (this.rhsIsList) {\n return this.list[0].tokens.value.type + \"-list\";\n }\n if (this.tokens.asterisk) {\n return \"*\";\n }\n if (this.tokens.secondaryName) {\n return this.tokens.secondaryName.type;\n }\n return null;\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { rhsType } = this;\n return w.ts.wrap([\n w.token(this.tokens.assign),\n w.token(this.tokens.asterisk),\n w.reference_token(this.tokens.secondaryName, this.parent),\n w.token(this.tokens.open),\n ...this.list.map((p) => {\n return rhsType === \"identifier-list\"\n ? w.identifier(p, this.parent)\n : p.write(w);\n }),\n w.token(this.tokens.close),\n ]);\n }\n}\n\nexport class SimpleExtendedAttribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consumeKind(\"identifier\");\n if (name) {\n return new SimpleExtendedAttribute({\n source: tokeniser.source,\n tokens: { name },\n params: ExtendedAttributeParameters.parse(tokeniser),\n });\n }\n }\n\n constructor({ source, tokens, params }) {\n super({ source, tokens });\n params.parent = this;\n Object.defineProperty(this, \"params\", { value: params });\n }\n\n get type() {\n return \"extended-attribute\";\n }\n get name() {\n return this.tokens.name.value;\n }\n get rhs() {\n const { rhsType: type, tokens, list } = this.params;\n if (!type) {\n return null;\n }\n const value = this.params.rhsIsList\n ? list\n : this.params.tokens.secondaryName\n ? unescape(tokens.secondaryName.value)\n : null;\n return { type, value };\n }\n get arguments() {\n const { rhsIsList, list } = this.params;\n if (!list || rhsIsList) {\n return [];\n }\n return list;\n }\n\n *validate(defs) {\n const { name } = this;\n if (name === \"LegacyNoInterfaceObject\") {\n const message = `\\`[LegacyNoInterfaceObject]\\` extended attribute is an \\\nundesirable feature that may be removed from Web IDL in the future. Refer to the \\\n[relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more \\\ninformation.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nointerfaceobject\",\n message,\n { level: \"warning\" }\n );\n } else if (renamedLegacies.has(name)) {\n const message = `\\`[${name}]\\` extended attribute is a legacy feature \\\nthat is now renamed to \\`[${renamedLegacies.get(name)}]\\`. Refer to the \\\n[relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more \\\ninformation.`;\n yield validationError(this.tokens.name, this, \"renamed-legacy\", message, {\n level: \"warning\",\n autofix: renameLegacyExtendedAttribute(this),\n });\n }\n for (const arg of this.arguments) {\n yield* arg.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.ts.trivia(this.tokens.name.trivia),\n w.ts.extendedAttribute(\n w.ts.wrap([\n w.ts.extendedAttributeReference(this.name),\n this.params.write(w),\n ])\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {SimpleExtendedAttribute} extAttr\n */\nfunction renameLegacyExtendedAttribute(extAttr) {\n return () => {\n const { name } = extAttr;\n extAttr.tokens.name.value = renamedLegacies.get(name);\n if (name === \"TreatNullAs\") {\n extAttr.params.tokens = {};\n }\n };\n}\n\n// Note: we parse something simpler than the official syntax. It's all that ever\n// seems to be used\nexport class ExtendedAttributes extends ArrayBase {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"[\");\n const ret = new ExtendedAttributes({ source: tokeniser.source, tokens });\n if (!tokens.open) return ret;\n ret.push(\n ...list(tokeniser, {\n parser: SimpleExtendedAttribute.parse,\n listName: \"extended attribute\",\n })\n );\n tokens.close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\n \"Expected a closing token for the extended attribute list\"\n );\n if (!ret.length) {\n tokeniser.unconsume(tokens.close.index);\n tokeniser.error(\"An extended attribute list must not be empty\");\n }\n if (tokeniser.probe(\"[\")) {\n tokeniser.error(\n \"Illegal double extended attribute lists, consider merging them\"\n );\n }\n return ret;\n }\n\n *validate(defs) {\n for (const extAttr of this) {\n yield* extAttr.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n if (!this.length) return \"\";\n return w.ts.wrap([\n w.token(this.tokens.open),\n ...this.map((ea) => ea.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n return_type,\n primitive_type,\n autoParenter,\n} from \"./helpers.js\";\nimport { stringTypes, typeNameKeywords } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction generic_type(tokeniser, typeName) {\n const base = tokeniser.consume(\n \"FrozenArray\",\n \"ObservableArray\",\n \"Promise\",\n \"sequence\",\n \"record\"\n );\n if (!base) {\n return;\n }\n const ret = autoParenter(\n new Type({ source: tokeniser.source, tokens: { base } })\n );\n ret.tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`No opening bracket after ${base.value}`);\n switch (base.value) {\n case \"Promise\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Promise type cannot have extended attribute\");\n const subtype =\n return_type(tokeniser, typeName) ||\n tokeniser.error(\"Missing Promise subtype\");\n ret.subtype.push(subtype);\n break;\n }\n case \"sequence\":\n case \"FrozenArray\":\n case \"ObservableArray\": {\n const subtype =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(`Missing ${base.value} subtype`);\n ret.subtype.push(subtype);\n break;\n }\n case \"record\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Record key cannot have extended attribute\");\n const keyType =\n tokeniser.consume(...stringTypes) ||\n tokeniser.error(`Record key must be one of: ${stringTypes.join(\", \")}`);\n const keyIdlType = new Type({\n source: tokeniser.source,\n tokens: { base: keyType },\n });\n keyIdlType.tokens.separator =\n tokeniser.consume(\",\") ||\n tokeniser.error(\"Missing comma after record key type\");\n keyIdlType.type = typeName;\n const valueType =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(\"Error parsing generic type record\");\n ret.subtype.push(keyIdlType, valueType);\n break;\n }\n }\n if (!ret.idlType) tokeniser.error(`Error parsing generic type ${base.value}`);\n ret.tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing closing bracket after ${base.value}`);\n return ret.this;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction type_suffix(tokeniser, obj) {\n const nullable = tokeniser.consume(\"?\");\n if (nullable) {\n obj.tokens.nullable = nullable;\n }\n if (tokeniser.probe(\"?\")) tokeniser.error(\"Can't nullable more than once\");\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction single_type(tokeniser, typeName) {\n let ret = generic_type(tokeniser, typeName) || primitive_type(tokeniser);\n if (!ret) {\n const base =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(...stringTypes, ...typeNameKeywords);\n if (!base) {\n return;\n }\n ret = new Type({ source: tokeniser.source, tokens: { base } });\n if (tokeniser.probe(\"<\"))\n tokeniser.error(`Unsupported generic type ${base.value}`);\n }\n if (ret.generic === \"Promise\" && tokeniser.probe(\"?\")) {\n tokeniser.error(\"Promise type cannot be nullable\");\n }\n ret.type = typeName || null;\n type_suffix(tokeniser, ret);\n if (ret.nullable && ret.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be made nullable\");\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\nfunction union_type(tokeniser, type) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"(\");\n if (!tokens.open) return;\n const ret = autoParenter(new Type({ source: tokeniser.source, tokens }));\n ret.type = type || null;\n while (true) {\n const typ =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(\"No type after open parenthesis or 'or' in union type\");\n if (typ.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be included in a union type\");\n if (typ.generic === \"Promise\")\n tokeniser.error(\"Type `Promise` cannot be included in a union type\");\n ret.subtype.push(typ);\n const or = tokeniser.consume(\"or\");\n if (or) {\n typ.tokens.separator = or;\n } else break;\n }\n if (ret.idlType.length < 2) {\n tokeniser.error(\n \"At least two types are expected in a union type but found less\"\n );\n }\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated union type\");\n type_suffix(tokeniser, ret);\n return ret.this;\n}\n\nexport class Type extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\n static parse(tokeniser, typeName) {\n return single_type(tokeniser, typeName) || union_type(tokeniser, typeName);\n }\n\n constructor({ source, tokens }) {\n super({ source, tokens });\n Object.defineProperty(this, \"subtype\", { value: [], writable: true });\n this.extAttrs = new ExtendedAttributes({ source, tokens: {} });\n }\n\n get generic() {\n if (this.subtype.length && this.tokens.base) {\n return this.tokens.base.value;\n }\n return \"\";\n }\n get nullable() {\n return Boolean(this.tokens.nullable);\n }\n get union() {\n return Boolean(this.subtype.length) && !this.tokens.base;\n }\n get idlType() {\n if (this.subtype.length) {\n return this.subtype;\n }\n // Adding prefixes/postfixes for \"unrestricted float\", etc.\n const name = [this.tokens.prefix, this.tokens.base, this.tokens.postfix]\n .filter((t) => t)\n .map((t) => t.value)\n .join(\" \");\n return unescape(name);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n\n if (this.idlType === \"void\") {\n const message = `\\`void\\` is now replaced by \\`undefined\\`. Refer to the \\\n[relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) \\\nfor more information.`;\n yield validationError(this.tokens.base, this, \"replace-void\", message, {\n autofix: replaceVoid(this),\n });\n }\n\n /*\n * If a union is nullable, its subunions cannot include a dictionary\n * If not, subunions may include dictionaries if each union is not nullable\n */\n const typedef = !this.union && defs.unique.get(this.idlType);\n const target = this.union\n ? this\n : typedef && typedef.type === \"typedef\"\n ? typedef.idlType\n : undefined;\n if (target && this.nullable) {\n // do not allow any dictionary\n const { reference } = idlTypeIncludesDictionary(target, defs) || {};\n if (reference) {\n const targetToken = (this.union ? reference : this).tokens.base;\n const message = \"Nullable union cannot include a dictionary type.\";\n yield validationError(\n targetToken,\n this,\n \"no-nullable-union-dict\",\n message\n );\n }\n } else {\n // allow some dictionary\n for (const subtype of this.subtype) {\n yield* subtype.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const type_body = () => {\n if (this.union || this.generic) {\n return w.ts.wrap([\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n ...this.subtype.map((t) => t.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n const firstToken = this.tokens.prefix || this.tokens.base;\n const prefix = this.tokens.prefix\n ? [this.tokens.prefix.value, w.ts.trivia(this.tokens.base.trivia)]\n : [];\n const ref = w.reference(\n w.ts.wrap([\n ...prefix,\n this.tokens.base.value,\n w.token(this.tokens.postfix),\n ]),\n {\n unescaped: /** @type {string} (because it's not union) */ (\n this.idlType\n ),\n context: this,\n }\n );\n return w.ts.wrap([w.ts.trivia(firstToken.trivia), ref]);\n };\n return w.ts.wrap([\n this.extAttrs.write(w),\n type_body(),\n w.token(this.tokens.nullable),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Type} type\n */\nfunction replaceVoid(type) {\n return () => {\n type.tokens.base.value = \"undefined\";\n };\n}\n","import { Base } from \"./base.js\";\nimport { const_data, const_value } from \"./helpers.js\";\n\nexport class Default extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const assign = tokeniser.consume(\"=\");\n if (!assign) {\n return null;\n }\n const def =\n const_value(tokeniser) ||\n tokeniser.consumeKind(\"string\") ||\n tokeniser.consume(\"null\", \"[\", \"{\") ||\n tokeniser.error(\"No value for default\");\n const expression = [def];\n if (def.value === \"[\") {\n const close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\"Default sequence value must be empty\");\n expression.push(close);\n } else if (def.value === \"{\") {\n const close =\n tokeniser.consume(\"}\") ||\n tokeniser.error(\"Default dictionary value must be empty\");\n expression.push(close);\n }\n return new Default({\n source: tokeniser.source,\n tokens: { assign },\n expression,\n });\n }\n\n constructor({ source, tokens, expression }) {\n super({ source, tokens });\n expression.parent = this;\n Object.defineProperty(this, \"expression\", { value: expression });\n }\n\n get type() {\n return const_data(this.expression[0]).type;\n }\n get value() {\n return const_data(this.expression[0]).value;\n }\n get negative() {\n return const_data(this.expression[0]).negative;\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.assign),\n ...this.expression.map((t) => w.token(t)),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport { Default } from \"./default.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n getFirstToken,\n} from \"./helpers.js\";\nimport { argumentNameKeywords, Tokeniser } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport {\n idlTypeIncludesDictionary,\n dictionaryIncludesRequiredField,\n} from \"../validators/helpers.js\";\n\nexport class Argument extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(\n new Argument({ source: tokeniser.source, tokens })\n );\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.optional = tokeniser.consume(\"optional\");\n ret.idlType = type_with_extended_attributes(tokeniser, \"argument-type\");\n if (!ret.idlType) {\n return tokeniser.unconsume(start_position);\n }\n if (!tokens.optional) {\n tokens.variadic = tokeniser.consume(\"...\");\n }\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(...argumentNameKeywords);\n if (!tokens.name) {\n return tokeniser.unconsume(start_position);\n }\n ret.default = tokens.optional ? Default.parse(tokeniser) : null;\n return ret.this;\n }\n\n get type() {\n return \"argument\";\n }\n get optional() {\n return !!this.tokens.optional;\n }\n get variadic() {\n return !!this.tokens.variadic;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /**\n * @param {import(\"../validator.js\").Definitions} defs\n */\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n const result = idlTypeIncludesDictionary(this.idlType, defs, {\n useNullableInner: true,\n });\n if (result) {\n if (this.idlType.nullable) {\n const message = `Dictionary arguments cannot be nullable.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nullable-dict-arg\",\n message\n );\n } else if (!this.optional) {\n if (\n this.parent &&\n !dictionaryIncludesRequiredField(result.dictionary, defs) &&\n isLastRequiredArgument(this)\n ) {\n const message = `Dictionary argument must be optional if it has no required fields`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-optional\",\n message,\n {\n autofix: autofixDictionaryArgumentOptionality(this),\n }\n );\n }\n } else if (!this.default) {\n const message = `Optional dictionary arguments must have a default value of \\`{}\\`.`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-default\",\n message,\n {\n autofix: autofixOptionalDictionaryDefaultValue(this),\n }\n );\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.optional),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.variadic),\n w.name_token(this.tokens.name, { data: this }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Argument} arg\n */\nfunction isLastRequiredArgument(arg) {\n const list = arg.parent.arguments || arg.parent.list;\n const index = list.indexOf(arg);\n const requiredExists = list.slice(index + 1).some((a) => !a.optional);\n return !requiredExists;\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixDictionaryArgumentOptionality(arg) {\n return () => {\n const firstToken = getFirstToken(arg.idlType);\n arg.tokens.optional = {\n ...firstToken,\n type: \"optional\",\n value: \"optional\",\n };\n firstToken.trivia = \" \";\n autofixOptionalDictionaryDefaultValue(arg)();\n };\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixOptionalDictionaryDefaultValue(arg) {\n return () => {\n arg.default = Default.parse(new Tokeniser(\" = {}\"));\n };\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\nexport class Operation extends Base {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {Token} [options.special]\n * @param {Token} [options.regular]\n */\n static parse(tokeniser, { special, regular } = {}) {\n const tokens = { special };\n const ret = autoParenter(\n new Operation({ source: tokeniser.source, tokens })\n );\n if (special && special.value === \"stringifier\") {\n tokens.termination = tokeniser.consume(\";\");\n if (tokens.termination) {\n ret.arguments = [];\n return ret;\n }\n }\n if (!special && !regular) {\n tokens.special = tokeniser.consume(\"getter\", \"setter\", \"deleter\");\n }\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Missing return type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") || tokeniser.consume(\"includes\");\n tokens.open =\n tokeniser.consume(\"(\") || tokeniser.error(\"Invalid operation\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated operation\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated operation, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"operation\";\n }\n get name() {\n const { name } = this.tokens;\n if (!name) {\n return \"\";\n }\n return unescape(name.value);\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (!this.name && [\"\", \"static\"].includes(this.special)) {\n const message = `Regular or static operations must have both a return type and an identifier.`;\n yield validationError(this.tokens.open, this, \"incomplete-op\", message);\n }\n if (this.idlType) {\n yield* this.idlType.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n const body = this.idlType\n ? [\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n ]\n : [];\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n this.tokens.name\n ? w.token(this.tokens.special)\n : w.token(this.tokens.special, w.ts.nameless, { data: this, parent }),\n ...body,\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Attribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.special]\n * @param {boolean} [options.noInherit]\n * @param {boolean} [options.readonly]\n */\n static parse(\n tokeniser,\n { special, noInherit = false, readonly = false } = {}\n ) {\n const start_position = tokeniser.position;\n const tokens = { special };\n const ret = autoParenter(\n new Attribute({ source: tokeniser.source, tokens })\n );\n if (!special && !noInherit) {\n tokens.special = tokeniser.consume(\"inherit\");\n }\n if (ret.special === \"inherit\" && tokeniser.probe(\"readonly\")) {\n tokeniser.error(\"Inherited attributes cannot be read-only\");\n }\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (readonly && !tokens.readonly && tokeniser.probe(\"attribute\")) {\n tokeniser.error(\"Attributes must be readonly in this context\");\n }\n tokens.base = tokeniser.consume(\"attribute\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"attribute-type\") ||\n tokeniser.error(\"Attribute lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(\"async\", \"required\") ||\n tokeniser.error(\"Attribute lacks a name\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated attribute, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"attribute\";\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n\n switch (this.idlType.generic) {\n case \"sequence\":\n case \"record\": {\n const message = `Attributes cannot accept ${this.idlType.generic} types.`;\n yield validationError(\n this.tokens.name,\n this,\n \"attr-invalid-type\",\n message\n );\n break;\n }\n default: {\n const { reference } =\n idlTypeIncludesDictionary(this.idlType, defs) || {};\n if (reference) {\n const targetToken = (this.idlType.union ? reference : this.idlType)\n .tokens.base;\n const message = \"Attributes cannot accept dictionary types.\";\n yield validationError(\n targetToken,\n this,\n \"attr-invalid-type\",\n message\n );\n }\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.special),\n w.token(this.tokens.readonly),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Type } from \"./type.js\";\nimport { Argument } from \"./argument.js\";\nimport {\n ExtendedAttributes,\n SimpleExtendedAttribute,\n} from \"./extended-attributes.js\";\nimport { Operation } from \"./operation.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\n\n/**\n * @param {string} identifier\n */\nexport function unescape(identifier) {\n return identifier.startsWith(\"_\") ? identifier.slice(1) : identifier;\n}\n\n/**\n * Parses comma-separated list\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} args\n * @param {Function} args.parser parser function for each item\n * @param {boolean} [args.allowDangler] whether to allow dangling comma\n * @param {string} [args.listName] the name to be shown on error messages\n */\nexport function list(tokeniser, { parser, allowDangler, listName = \"list\" }) {\n const first = parser(tokeniser);\n if (!first) {\n return [];\n }\n first.tokens.separator = tokeniser.consume(\",\");\n const items = [first];\n while (first.tokens.separator) {\n const item = parser(tokeniser);\n if (!item) {\n if (!allowDangler) {\n tokeniser.error(`Trailing comma in ${listName}`);\n }\n break;\n }\n item.tokens.separator = tokeniser.consume(\",\");\n items.push(item);\n if (!item.tokens.separator) break;\n }\n return items;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function const_value(tokeniser) {\n return (\n tokeniser.consumeKind(\"decimal\", \"integer\") ||\n tokeniser.consume(\"true\", \"false\", \"Infinity\", \"-Infinity\", \"NaN\")\n );\n}\n\n/**\n * @param {object} token\n * @param {string} token.type\n * @param {string} token.value\n */\nexport function const_data({ type, value }) {\n switch (type) {\n case \"decimal\":\n case \"integer\":\n return { type: \"number\", value };\n case \"string\":\n return { type: \"string\", value: value.slice(1, -1) };\n }\n\n switch (value) {\n case \"true\":\n case \"false\":\n return { type: \"boolean\", value: value === \"true\" };\n case \"Infinity\":\n case \"-Infinity\":\n return { type: \"Infinity\", negative: value.startsWith(\"-\") };\n case \"[\":\n return { type: \"sequence\", value: [] };\n case \"{\":\n return { type: \"dictionary\" };\n default:\n return { type: value };\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function primitive_type(tokeniser) {\n function integer_type() {\n const prefix = tokeniser.consume(\"unsigned\");\n const base = tokeniser.consume(\"short\", \"long\");\n if (base) {\n const postfix = tokeniser.consume(\"long\");\n return new Type({ source, tokens: { prefix, base, postfix } });\n }\n if (prefix) tokeniser.error(\"Failed to parse integer type\");\n }\n\n function decimal_type() {\n const prefix = tokeniser.consume(\"unrestricted\");\n const base = tokeniser.consume(\"float\", \"double\");\n if (base) {\n return new Type({ source, tokens: { prefix, base } });\n }\n if (prefix) tokeniser.error(\"Failed to parse float type\");\n }\n\n const { source } = tokeniser;\n const num_type = integer_type() || decimal_type();\n if (num_type) return num_type;\n const base = tokeniser.consume(\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"octet\",\n \"undefined\"\n );\n if (base) {\n return new Type({ source, tokens: { base } });\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function argument_list(tokeniser) {\n return list(tokeniser, {\n parser: Argument.parse,\n listName: \"arguments list\",\n });\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\n */\nexport function type_with_extended_attributes(tokeniser, typeName) {\n const extAttrs = ExtendedAttributes.parse(tokeniser);\n const ret = Type.parse(tokeniser, typeName);\n if (ret) autoParenter(ret).extAttrs = extAttrs;\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\n */\nexport function return_type(tokeniser, typeName) {\n const typ = Type.parse(tokeniser, typeName || \"return-type\");\n if (typ) {\n return typ;\n }\n const voidToken = tokeniser.consume(\"void\");\n if (voidToken) {\n const ret = new Type({\n source: tokeniser.source,\n tokens: { base: voidToken },\n });\n ret.type = \"return-type\";\n return ret;\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function stringifier(tokeniser) {\n const special = tokeniser.consume(\"stringifier\");\n if (!special) return;\n const member =\n Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"Unterminated stringifier\");\n return member;\n}\n\n/**\n * @param {string} str\n */\nexport function getLastIndentation(str) {\n const lines = str.split(\"\\n\");\n // the first line visually binds to the preceding token\n if (lines.length) {\n const match = lines[lines.length - 1].match(/^\\s+/);\n if (match) {\n return match[0];\n }\n }\n return \"\";\n}\n\n/**\n * @param {string} parentTrivia\n */\nexport function getMemberIndentation(parentTrivia) {\n const indentation = getLastIndentation(parentTrivia);\n const indentCh = indentation.includes(\"\\t\") ? \"\\t\" : \" \";\n return indentation + indentCh;\n}\n\n/**\n * @param {import(\"./interface.js\").Interface} def\n */\nexport function autofixAddExposedWindow(def) {\n return () => {\n if (def.extAttrs.length) {\n const tokeniser = new Tokeniser(\"Exposed=Window,\");\n const exposed = SimpleExtendedAttribute.parse(tokeniser);\n exposed.tokens.separator = tokeniser.consume(\",\");\n const existing = def.extAttrs[0];\n if (!/^\\s/.test(existing.tokens.name.trivia)) {\n existing.tokens.name.trivia = ` ${existing.tokens.name.trivia}`;\n }\n def.extAttrs.unshift(exposed);\n } else {\n autoParenter(def).extAttrs = ExtendedAttributes.parse(\n new Tokeniser(\"[Exposed=Window]\")\n );\n const trivia = def.tokens.base.trivia;\n def.extAttrs.tokens.open.trivia = trivia;\n def.tokens.base.trivia = `\\n${getLastIndentation(trivia)}`;\n }\n };\n}\n\n/**\n * Get the first syntax token for the given IDL object.\n * @param {*} data\n */\nexport function getFirstToken(data) {\n if (data.extAttrs.length) {\n return data.extAttrs.tokens.open;\n }\n if (data.type === \"operation\" && !data.special) {\n return getFirstToken(data.idlType);\n }\n const tokens = Object.values(data.tokens).sort((x, y) => x.index - y.index);\n return tokens[0];\n}\n\n/**\n * @template T\n * @param {T[]} array\n * @param {(item: T) => boolean} predicate\n */\nexport function findLastIndex(array, predicate) {\n const index = array.slice().reverse().findIndex(predicate);\n if (index === -1) {\n return index;\n }\n return array.length - index - 1;\n}\n\n/**\n * Returns a proxy that auto-assign `parent` field.\n * @template {Record<string | symbol, any>} T\n * @param {T} data\n * @param {*} [parent] The object that will be assigned to `parent`.\n * If absent, it will be `data` by default.\n * @return {T}\n */\nexport function autoParenter(data, parent) {\n if (!parent) {\n // Defaults to `data` unless specified otherwise.\n parent = data;\n }\n if (!data) {\n // This allows `autoParenter(undefined)` which again allows\n // `autoParenter(parse())` where the function may return nothing.\n return data;\n }\n const proxy = new Proxy(data, {\n get(target, p) {\n const value = target[p];\n if (Array.isArray(value) && p !== \"source\") {\n // Wraps the array so that any added items will also automatically\n // get their `parent` values.\n return autoParenter(value, target);\n }\n return value;\n },\n set(target, p, value) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/47357\n target[p] = value;\n if (!value) {\n return true;\n } else if (Array.isArray(value)) {\n // Assigning an array will add `parent` to its items.\n for (const item of value) {\n if (typeof item.parent !== \"undefined\") {\n item.parent = parent;\n }\n }\n } else if (typeof value.parent !== \"undefined\") {\n value.parent = parent;\n }\n return true;\n },\n });\n return proxy;\n}\n","import { syntaxError } from \"./error.js\";\nimport { unescape } from \"./productions/helpers.js\";\n\n// These regular expressions use the sticky flag so they will only match at\n// the current location (ie. the offset of lastIndex).\nconst tokenRe = {\n // This expression uses a lookahead assertion to catch false matches\n // against integers early.\n decimal:\n /-?(?=[0-9]*\\.|[0-9]+[eE])(([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,\n integer: /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,\n identifier: /[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,\n string: /\"[^\"]*\"/y,\n whitespace: /[\\t\\n\\r ]+/y,\n comment: /\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\//y,\n other: /[^\\t\\n\\r 0-9A-Za-z]/y,\n};\n\nexport const typeNameKeywords = [\n \"ArrayBuffer\",\n \"DataView\",\n \"Int8Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Uint8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8ClampedArray\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"any\",\n \"object\",\n \"symbol\",\n];\n\nexport const stringTypes = [\"ByteString\", \"DOMString\", \"USVString\"];\n\nexport const argumentNameKeywords = [\n \"async\",\n \"attribute\",\n \"callback\",\n \"const\",\n \"constructor\",\n \"deleter\",\n \"dictionary\",\n \"enum\",\n \"getter\",\n \"includes\",\n \"inherit\",\n \"interface\",\n \"iterable\",\n \"maplike\",\n \"namespace\",\n \"partial\",\n \"required\",\n \"setlike\",\n \"setter\",\n \"static\",\n \"stringifier\",\n \"typedef\",\n \"unrestricted\",\n];\n\nconst nonRegexTerminals = [\n \"-Infinity\",\n \"FrozenArray\",\n \"Infinity\",\n \"NaN\",\n \"ObservableArray\",\n \"Promise\",\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"double\",\n \"false\",\n \"float\",\n \"long\",\n \"mixin\",\n \"null\",\n \"octet\",\n \"optional\",\n \"or\",\n \"readonly\",\n \"record\",\n \"sequence\",\n \"short\",\n \"true\",\n \"undefined\",\n \"unsigned\",\n \"void\",\n].concat(argumentNameKeywords, stringTypes, typeNameKeywords);\n\nconst punctuations = [\n \"(\",\n \")\",\n \",\",\n \"...\",\n \":\",\n \";\",\n \"<\",\n \"=\",\n \">\",\n \"?\",\n \"*\",\n \"[\",\n \"]\",\n \"{\",\n \"}\",\n];\n\nconst reserved = [\n // \"constructor\" is now a keyword\n \"_constructor\",\n \"toString\",\n \"_toString\",\n];\n\n/**\n * @typedef {ArrayItemType<ReturnType<typeof tokenise>>} Token\n * @param {string} str\n */\nfunction tokenise(str) {\n const tokens = [];\n let lastCharIndex = 0;\n let trivia = \"\";\n let line = 1;\n let index = 0;\n while (lastCharIndex < str.length) {\n const nextChar = str.charAt(lastCharIndex);\n let result = -1;\n\n if (/[\\t\\n\\r ]/.test(nextChar)) {\n result = attemptTokenMatch(\"whitespace\", { noFlushTrivia: true });\n } else if (nextChar === \"/\") {\n result = attemptTokenMatch(\"comment\", { noFlushTrivia: true });\n }\n\n if (result !== -1) {\n const currentTrivia = tokens.pop().value;\n line += (currentTrivia.match(/\\n/g) || []).length;\n trivia += currentTrivia;\n index -= 1;\n } else if (/[-0-9.A-Z_a-z]/.test(nextChar)) {\n result = attemptTokenMatch(\"decimal\");\n if (result === -1) {\n result = attemptTokenMatch(\"integer\");\n }\n if (result === -1) {\n result = attemptTokenMatch(\"identifier\");\n const lastIndex = tokens.length - 1;\n const token = tokens[lastIndex];\n if (result !== -1) {\n if (reserved.includes(token.value)) {\n const message = `${unescape(\n token.value\n )} is a reserved identifier and must not be used.`;\n throw new WebIDLParseError(\n syntaxError(tokens, lastIndex, null, message)\n );\n } else if (nonRegexTerminals.includes(token.value)) {\n token.type = \"inline\";\n }\n }\n }\n } else if (nextChar === '\"') {\n result = attemptTokenMatch(\"string\");\n }\n\n for (const punctuation of punctuations) {\n if (str.startsWith(punctuation, lastCharIndex)) {\n tokens.push({\n type: \"inline\",\n value: punctuation,\n trivia,\n line,\n index,\n });\n trivia = \"\";\n lastCharIndex += punctuation.length;\n result = lastCharIndex;\n break;\n }\n }\n\n // other as the last try\n if (result === -1) {\n result = attemptTokenMatch(\"other\");\n }\n if (result === -1) {\n throw new Error(\"Token stream not progressing\");\n }\n lastCharIndex = result;\n index += 1;\n }\n\n // remaining trivia as eof\n tokens.push({\n type: \"eof\",\n value: \"\",\n trivia,\n line,\n index,\n });\n\n return tokens;\n\n /**\n * @param {keyof typeof tokenRe} type\n * @param {object} options\n * @param {boolean} [options.noFlushTrivia]\n */\n function attemptTokenMatch(type, { noFlushTrivia } = {}) {\n const re = tokenRe[type];\n re.lastIndex = lastCharIndex;\n const result = re.exec(str);\n if (result) {\n tokens.push({ type, value: result[0], trivia, line, index });\n if (!noFlushTrivia) {\n trivia = \"\";\n }\n return re.lastIndex;\n }\n return -1;\n }\n}\n\nexport class Tokeniser {\n /**\n * @param {string} idl\n */\n constructor(idl) {\n this.source = tokenise(idl);\n this.position = 0;\n }\n\n /**\n * @param {string} message\n * @return {never}\n */\n error(message) {\n throw new WebIDLParseError(\n syntaxError(this.source, this.position, this.current, message)\n );\n }\n\n /**\n * @param {string} type\n */\n probeKind(type) {\n return (\n this.source.length > this.position &&\n this.source[this.position].type === type\n );\n }\n\n /**\n * @param {string} value\n */\n probe(value) {\n return (\n this.probeKind(\"inline\") && this.source[this.position].value === value\n );\n }\n\n /**\n * @param {...string} candidates\n */\n consumeKind(...candidates) {\n for (const type of candidates) {\n if (!this.probeKind(type)) continue;\n const token = this.source[this.position];\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {...string} candidates\n */\n consume(...candidates) {\n if (!this.probeKind(\"inline\")) return;\n const token = this.source[this.position];\n for (const value of candidates) {\n if (token.value !== value) continue;\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {string} value\n */\n consumeIdentifier(value) {\n if (!this.probeKind(\"identifier\")) {\n return;\n }\n if (this.source[this.position].value !== value) {\n return;\n }\n return this.consumeKind(\"identifier\");\n }\n\n /**\n * @param {number} position\n */\n unconsume(position) {\n this.position = position;\n }\n}\n\nexport class WebIDLParseError extends Error {\n /**\n * @param {object} options\n * @param {string} options.message\n * @param {string} options.bareMessage\n * @param {string} options.context\n * @param {number} options.line\n * @param {*} options.sourceName\n * @param {string} options.input\n * @param {*[]} options.tokens\n */\n constructor({\n message,\n bareMessage,\n context,\n line,\n sourceName,\n input,\n tokens,\n }) {\n super(message);\n\n this.name = \"WebIDLParseError\"; // not to be mangled\n this.bareMessage = bareMessage;\n this.context = context;\n this.line = line;\n this.sourceName = sourceName;\n this.input = input;\n this.tokens = tokens;\n }\n}\n","import { list, unescape, autoParenter } from \"./helpers.js\";\nimport { WrappedToken } from \"./token.js\";\nimport { Base } from \"./base.js\";\n\nexport class EnumValue extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"string\");\n if (value) {\n return new EnumValue({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"enum-value\";\n }\n get value() {\n return super.value.slice(1, -1);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.wrap([\n w.ts.trivia(this.tokens.value.trivia),\n w.ts.definition(\n w.ts.wrap(['\"', w.ts.name(this.value, { data: this, parent }), '\"']),\n { data: this, parent }\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Enum extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"enum\");\n if (!tokens.base) {\n return;\n }\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"No name for enum\");\n const ret = autoParenter(new Enum({ source: tokeniser.source, tokens }));\n tokeniser.current = ret.this;\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(\"Bodyless enum\");\n ret.values = list(tokeniser, {\n parser: EnumValue.parse,\n allowDangler: true,\n listName: \"enumeration\",\n });\n if (tokeniser.probeKind(\"string\")) {\n tokeniser.error(\"No comma between enum values\");\n }\n tokens.close =\n tokeniser.consume(\"}\") || tokeniser.error(\"Unexpected value in enum\");\n if (!ret.values.length) {\n tokeniser.error(\"No value in enum\");\n }\n tokens.termination =\n tokeniser.consume(\";\") || tokeniser.error(\"No semicolon after enum\");\n return ret.this;\n }\n\n get type() {\n return \"enum\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.open),\n w.ts.wrap(this.values.map((v) => v.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Includes extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const target = tokeniser.consumeKind(\"identifier\");\n if (!target) {\n return;\n }\n const tokens = { target };\n tokens.includes = tokeniser.consume(\"includes\");\n if (!tokens.includes) {\n tokeniser.unconsume(target.index);\n return;\n }\n tokens.mixin =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Incomplete includes statement\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"No terminating ; for includes statement\");\n return new Includes({ source: tokeniser.source, tokens });\n }\n\n get type() {\n return \"includes\";\n }\n get target() {\n return unescape(this.tokens.target.value);\n }\n get includes() {\n return unescape(this.tokens.mixin.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.reference_token(this.tokens.target, this),\n w.token(this.tokens.includes),\n w.reference_token(this.tokens.mixin, this),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Typedef extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Typedef({ source: tokeniser.source, tokens }));\n tokens.base = tokeniser.consume(\"typedef\");\n if (!tokens.base) {\n return;\n }\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"typedef-type\") ||\n tokeniser.error(\"Typedef lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Typedef lacks a name\");\n tokeniser.current = ret.this;\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated typedef, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"typedef\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class CallbackFunction extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base) {\n const tokens = { base };\n const ret = autoParenter(\n new CallbackFunction({ source: tokeniser.source, tokens })\n );\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Callback lacks a name\");\n tokeniser.current = ret.this;\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Callback lacks an assignment\");\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Callback lacks a return type\");\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"Callback lacks parentheses for arguments\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated callback\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated callback, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"callback\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.assign),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.open),\n ...this.arguments.map((arg) => arg.write(w)),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { unescape, autoParenter } from \"./helpers.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction inheritance(tokeniser) {\n const colon = tokeniser.consume(\":\");\n if (!colon) {\n return {};\n }\n const inheritance =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Inheritance lacks a type\");\n return { colon, inheritance };\n}\n\nexport class Container extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {*} instance TODO: This should be {T extends Container}, but see https://github.com/microsoft/TypeScript/issues/4628\n * @param {*} args\n */\n static parse(tokeniser, instance, { inheritable, allowedMembers }) {\n const { tokens, type } = instance;\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(`Missing name in ${type}`);\n tokeniser.current = instance;\n instance = autoParenter(instance);\n if (inheritable) {\n Object.assign(tokens, inheritance(tokeniser));\n }\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(`Bodyless ${type}`);\n instance.members = [];\n while (true) {\n tokens.close = tokeniser.consume(\"}\");\n if (tokens.close) {\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(`Missing semicolon after ${type}`);\n return instance.this;\n }\n const ea = ExtendedAttributes.parse(tokeniser);\n let mem;\n for (const [parser, ...args] of allowedMembers) {\n mem = autoParenter(parser(tokeniser, ...args));\n if (mem) {\n break;\n }\n }\n if (!mem) {\n tokeniser.error(\"Unknown member\");\n }\n mem.extAttrs = ea;\n instance.members.push(mem.this);\n }\n }\n\n get partial() {\n return !!this.tokens.partial;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get inheritance() {\n if (!this.tokens.inheritance) {\n return null;\n }\n return unescape(this.tokens.inheritance.value);\n }\n\n *validate(defs) {\n for (const member of this.members) {\n if (member.validate) {\n yield* member.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const inheritance = () => {\n if (!this.tokens.inheritance) {\n return \"\";\n }\n return w.ts.wrap([\n w.token(this.tokens.colon),\n w.ts.trivia(this.tokens.inheritance.trivia),\n w.ts.inheritance(\n w.reference(this.tokens.inheritance.value, { context: this })\n ),\n ]);\n };\n\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.callback),\n w.token(this.tokens.partial),\n w.token(this.tokens.base),\n w.token(this.tokens.mixin),\n w.name_token(this.tokens.name, { data: this }),\n inheritance(),\n w.token(this.tokens.open),\n w.ts.wrap(this.members.map((m) => m.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { Type } from \"./type.js\";\nimport {\n const_data,\n const_value,\n primitive_type,\n autoParenter,\n unescape,\n} from \"./helpers.js\";\n\nexport class Constant extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"const\");\n if (!tokens.base) {\n return;\n }\n let idlType = primitive_type(tokeniser);\n if (!idlType) {\n const base =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Const lacks a type\");\n idlType = new Type({ source: tokeniser.source, tokens: { base } });\n }\n if (tokeniser.probe(\"?\")) {\n tokeniser.error(\"Unexpected nullable constant type\");\n }\n idlType.type = \"const-type\";\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Const lacks a name\");\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Const lacks value assignment\");\n tokens.value =\n const_value(tokeniser) || tokeniser.error(\"Const lacks a value\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated const, expected `;`\");\n const ret = new Constant({ source: tokeniser.source, tokens });\n autoParenter(ret).idlType = idlType;\n return ret;\n }\n\n get type() {\n return \"const\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get value() {\n return const_data(this.tokens.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.assign),\n w.token(this.tokens.value),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n autoParenter,\n argument_list,\n} from \"./helpers.js\";\n\nexport class IterableLike extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n const ret = autoParenter(\n new IterableLike({ source: tokeniser.source, tokens: {} })\n );\n const { tokens } = ret;\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (!tokens.readonly) {\n tokens.async = tokeniser.consume(\"async\");\n }\n tokens.base = tokens.readonly\n ? tokeniser.consume(\"maplike\", \"setlike\")\n : tokens.async\n ? tokeniser.consume(\"iterable\")\n : tokeniser.consume(\"iterable\", \"maplike\", \"setlike\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n\n const { type } = ret;\n const secondTypeRequired = type === \"maplike\";\n const secondTypeAllowed = secondTypeRequired || type === \"iterable\";\n const argumentAllowed = ret.async && type === \"iterable\";\n\n tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`Missing less-than sign \\`<\\` in ${type} declaration`);\n const first =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(`Missing a type argument in ${type} declaration`);\n ret.idlType = [first];\n ret.arguments = [];\n\n if (secondTypeAllowed) {\n first.tokens.separator = tokeniser.consume(\",\");\n if (first.tokens.separator) {\n ret.idlType.push(type_with_extended_attributes(tokeniser));\n } else if (secondTypeRequired) {\n tokeniser.error(`Missing second type argument in ${type} declaration`);\n }\n }\n\n tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing greater-than sign \\`>\\` in ${type} declaration`);\n\n if (tokeniser.probe(\"(\")) {\n if (argumentAllowed) {\n tokens.argsOpen = tokeniser.consume(\"(\");\n ret.arguments.push(...argument_list(tokeniser));\n tokens.argsClose =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unterminated async iterable argument list\");\n } else {\n tokeniser.error(`Arguments are only allowed for \\`async iterable\\``);\n }\n }\n\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(`Missing semicolon after ${type} declaration`);\n\n return ret.this;\n }\n\n get type() {\n return this.tokens.base.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get async() {\n return !!this.tokens.async;\n }\n\n *validate(defs) {\n for (const type of this.idlType) {\n yield* type.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.readonly),\n w.token(this.tokens.async),\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n w.ts.wrap(this.idlType.map((t) => t.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.argsOpen),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.argsClose),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent: this.parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { argument_list, autoParenter } from \"./helpers.js\";\n\nexport class Constructor extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const base = tokeniser.consume(\"constructor\");\n if (!base) {\n return;\n }\n /** @type {Base[\"tokens\"]} */\n const tokens = { base };\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"No argument list in constructor\");\n const args = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated constructor\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"No semicolon after constructor\");\n const ret = new Constructor({ source: tokeniser.source, tokens });\n autoParenter(ret).arguments = args;\n return ret;\n }\n\n get type() {\n return \"constructor\";\n }\n\n *validate(defs) {\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base, w.ts.nameless, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\nimport { IterableLike } from \"./iterable.js\";\nimport {\n stringifier,\n autofixAddExposedWindow,\n getMemberIndentation,\n getLastIndentation,\n getFirstToken,\n findLastIndex,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\nimport { checkInterfaceMemberDuplication } from \"../validators/interface.js\";\nimport { Constructor } from \"./constructor.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction static_member(tokeniser) {\n const special = tokeniser.consume(\"static\");\n if (!special) return;\n const member =\n Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"No body in static member\");\n return member;\n}\n\nexport class Interface extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base, { partial = null } = {}) {\n const tokens = { partial, base };\n return Container.parse(\n tokeniser,\n new Interface({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Constructor.parse],\n [static_member],\n [stringifier],\n [IterableLike.parse],\n [Attribute.parse],\n [Operation.parse],\n ],\n }\n );\n }\n\n get type() {\n return \"interface\";\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\n const message = `Interfaces must have \\`[Exposed]\\` extended attribute. \\\nTo fix, add, for example, \\`[Exposed=Window]\\`. Please also consider carefully \\\nif your interface should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n const oldConstructors = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"Constructor\"\n );\n for (const constructor of oldConstructors) {\n const message = `Constructors should now be represented as a \\`constructor()\\` operation on the interface \\\ninstead of \\`[Constructor]\\` extended attribute. Refer to the \\\n[WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) \\\nfor more information.`;\n yield validationError(\n constructor.tokens.name,\n this,\n \"constructor-member\",\n message,\n {\n autofix: autofixConstructor(this, constructor),\n }\n );\n }\n\n const isGlobal = this.extAttrs.some((extAttr) => extAttr.name === \"Global\");\n if (isGlobal) {\n const factoryFunctions = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"LegacyFactoryFunction\"\n );\n for (const named of factoryFunctions) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have factory functions.`;\n yield validationError(\n named.tokens.name,\n this,\n \"no-constructible-global\",\n message\n );\n }\n\n const constructors = this.members.filter(\n (member) => member.type === \"constructor\"\n );\n for (const named of constructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have constructors.`;\n yield validationError(\n named.tokens.base,\n this,\n \"no-constructible-global\",\n message\n );\n }\n }\n\n yield* super.validate(defs);\n if (!this.partial) {\n yield* checkInterfaceMemberDuplication(defs, this);\n }\n }\n}\n\nfunction autofixConstructor(interfaceDef, constructorExtAttr) {\n interfaceDef = autoParenter(interfaceDef);\n return () => {\n const indentation = getLastIndentation(\n interfaceDef.extAttrs.tokens.open.trivia\n );\n const memberIndent = interfaceDef.members.length\n ? getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia)\n : getMemberIndentation(indentation);\n const constructorOp = Constructor.parse(\n new Tokeniser(`\\n${memberIndent}constructor();`)\n );\n constructorOp.extAttrs = new ExtendedAttributes({\n source: interfaceDef.source,\n tokens: {},\n });\n autoParenter(constructorOp).arguments = constructorExtAttr.arguments;\n\n const existingIndex = findLastIndex(\n interfaceDef.members,\n (m) => m.type === \"constructor\"\n );\n interfaceDef.members.splice(existingIndex + 1, 0, constructorOp);\n\n const { close } = interfaceDef.tokens;\n if (!close.trivia.includes(\"\\n\")) {\n close.trivia += `\\n${indentation}`;\n }\n\n const { extAttrs } = interfaceDef;\n const index = extAttrs.indexOf(constructorExtAttr);\n const removed = extAttrs.splice(index, 1);\n if (!extAttrs.length) {\n extAttrs.tokens.open = extAttrs.tokens.close = undefined;\n } else if (extAttrs.length === index) {\n extAttrs[index - 1].tokens.separator = undefined;\n } else if (!extAttrs[index].tokens.name.trivia.trim()) {\n extAttrs[index].tokens.name.trivia = removed[0].tokens.name.trivia;\n }\n };\n}\n","import { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {import(\"../productions/container.js\").Container} i\n */\nexport function* checkInterfaceMemberDuplication(defs, i) {\n const opNames = groupOperationNames(i);\n const partials = defs.partials.get(i.name) || [];\n const mixins = defs.mixinMap.get(i.name) || [];\n for (const ext of [...partials, ...mixins]) {\n const additions = getOperations(ext);\n const statics = additions.filter((a) => a.special === \"static\");\n const nonstatics = additions.filter((a) => a.special !== \"static\");\n yield* checkAdditions(statics, opNames.statics, ext, i);\n yield* checkAdditions(nonstatics, opNames.nonstatics, ext, i);\n statics.forEach((op) => opNames.statics.add(op.name));\n nonstatics.forEach((op) => opNames.nonstatics.add(op.name));\n }\n\n /**\n * @param {import(\"../productions/operation.js\").Operation[]} additions\n * @param {Set<string>} existings\n * @param {import(\"../productions/container.js\").Container} ext\n * @param {import(\"../productions/container.js\").Container} base\n */\n function* checkAdditions(additions, existings, ext, base) {\n for (const addition of additions) {\n const { name } = addition;\n if (name && existings.has(name)) {\n const isStatic = addition.special === \"static\" ? \"static \" : \"\";\n const message = `The ${isStatic}operation \"${name}\" has already been defined for the base interface \"${base.name}\" either in itself or in a mixin`;\n yield validationError(\n addition.tokens.name,\n ext,\n \"no-cross-overload\",\n message\n );\n }\n }\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n * @returns {import(\"../productions/operation.js\").Operation[]}\n */\n function getOperations(i) {\n return i.members.filter(({ type }) => type === \"operation\");\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n */\n function groupOperationNames(i) {\n const ops = getOperations(i);\n return {\n statics: new Set(\n ops.filter((op) => op.special === \"static\").map((op) => op.name)\n ),\n nonstatics: new Set(\n ops.filter((op) => op.special !== \"static\").map((op) => op.name)\n ),\n };\n }\n}\n","import { Container } from \"./container.js\";\nimport { Constant } from \"./constant.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { stringifier } from \"./helpers.js\";\n\nexport class Mixin extends Container {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {Token} base\n * @param {object} [options]\n * @param {Token} [options.partial]\n */\n static parse(tokeniser, base, { partial } = {}) {\n const tokens = { partial, base };\n tokens.mixin = tokeniser.consume(\"mixin\");\n if (!tokens.mixin) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Mixin({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n [Constant.parse],\n [stringifier],\n [Attribute.parse, { noInherit: true }],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"interface mixin\";\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n} from \"./helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { Default } from \"./default.js\";\n\nexport class Field extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Field({ source: tokeniser.source, tokens }));\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.required = tokeniser.consume(\"required\");\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"dictionary-type\") ||\n tokeniser.error(\"Dictionary member lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Dictionary member lacks a name\");\n ret.default = Default.parse(tokeniser);\n if (tokens.required && ret.default)\n tokeniser.error(\"Required member must not have a default\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated dictionary member, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"field\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get required() {\n return !!this.tokens.required;\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.required),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Container } from \"./container.js\";\nimport { Field } from \"./field.js\";\n\nexport class Dictionary extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"dictionary\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Dictionary({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [[Field.parse]],\n }\n );\n }\n\n get type() {\n return \"dictionary\";\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { validationError } from \"../error.js\";\nimport { autofixAddExposedWindow } from \"./helpers.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class Namespace extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"namespace\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Namespace({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n [Attribute.parse, { noInherit: true, readonly: true }],\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"namespace\";\n }\n\n *validate(defs) {\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\n const message = `Namespaces must have [Exposed] extended attribute. \\\nTo fix, add, for example, [Exposed=Window]. Please also consider carefully \\\nif your namespace should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n yield* super.validate(defs);\n }\n}\n","import { Container } from \"./container.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class CallbackInterface extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, callback, { partial = null } = {}) {\n const tokens = { callback };\n tokens.base = tokeniser.consume(\"interface\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new CallbackInterface({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"callback interface\";\n }\n}\n","import { Tokeniser } from \"./tokeniser.js\";\nimport { Enum } from \"./productions/enum.js\";\nimport { Includes } from \"./productions/includes.js\";\nimport { ExtendedAttributes } from \"./productions/extended-attributes.js\";\nimport { Typedef } from \"./productions/typedef.js\";\nimport { CallbackFunction } from \"./productions/callback.js\";\nimport { Interface } from \"./productions/interface.js\";\nimport { Mixin } from \"./productions/mixin.js\";\nimport { Dictionary } from \"./productions/dictionary.js\";\nimport { Namespace } from \"./productions/namespace.js\";\nimport { CallbackInterface } from \"./productions/callback-interface.js\";\nimport { autoParenter } from \"./productions/helpers.js\";\nimport { Eof } from \"./productions/token.js\";\n\n/**\n * @param {Tokeniser} tokeniser\n * @param {object} options\n * @param {boolean} [options.concrete]\n * @param {Function[]} [options.productions]\n */\nfunction parseByTokens(tokeniser, options) {\n const source = tokeniser.source;\n\n function error(str) {\n tokeniser.error(str);\n }\n\n function consume(...candidates) {\n return tokeniser.consume(...candidates);\n }\n\n function callback() {\n const callback = consume(\"callback\");\n if (!callback) return;\n if (tokeniser.probe(\"interface\")) {\n return CallbackInterface.parse(tokeniser, callback);\n }\n return CallbackFunction.parse(tokeniser, callback);\n }\n\n function interface_(opts) {\n const base = consume(\"interface\");\n if (!base) return;\n const ret =\n Mixin.parse(tokeniser, base, opts) ||\n Interface.parse(tokeniser, base, opts) ||\n error(\"Interface has no proper body\");\n return ret;\n }\n\n function partial() {\n const partial = consume(\"partial\");\n if (!partial) return;\n return (\n Dictionary.parse(tokeniser, { partial }) ||\n interface_({ partial }) ||\n Namespace.parse(tokeniser, { partial }) ||\n error(\"Partial doesn't apply to anything\")\n );\n }\n\n function definition() {\n if (options.productions) {\n for (const production of options.productions) {\n const result = production(tokeniser);\n if (result) {\n return result;\n }\n }\n }\n\n return (\n callback() ||\n interface_() ||\n partial() ||\n Dictionary.parse(tokeniser) ||\n Enum.parse(tokeniser) ||\n Typedef.parse(tokeniser) ||\n Includes.parse(tokeniser) ||\n Namespace.parse(tokeniser)\n );\n }\n\n function definitions() {\n if (!source.length) return [];\n const defs = [];\n while (true) {\n const ea = ExtendedAttributes.parse(tokeniser);\n const def = definition();\n if (!def) {\n if (ea.length) error(\"Stray extended attributes\");\n break;\n }\n autoParenter(def).extAttrs = ea;\n defs.push(def);\n }\n const eof = Eof.parse(tokeniser);\n if (options.concrete) {\n defs.push(eof);\n }\n return defs;\n }\n const res = definitions();\n if (tokeniser.position < source.length) error(\"Unrecognised tokens\");\n return res;\n}\n\n/**\n * @param {string} str\n * @param {object} [options]\n * @param {*} [options.sourceName]\n * @param {boolean} [options.concrete]\n * @param {Function[]} [options.productions]\n * @return {import(\"./productions/base.js\").Base[]}\n */\nexport function parse(str, options = {}) {\n const tokeniser = new Tokeniser(str);\n if (typeof options.sourceName !== \"undefined\") {\n // @ts-ignore (See Tokeniser.source in supplement.d.ts)\n tokeniser.source.name = options.sourceName;\n }\n return parseByTokens(tokeniser, options);\n}\n","function noop(arg) {\n return arg;\n}\n\nconst templates = {\n wrap: (items) => items.join(\"\"),\n trivia: noop,\n name: noop,\n reference: noop,\n type: noop,\n generic: noop,\n nameless: noop,\n inheritance: noop,\n definition: noop,\n extendedAttribute: noop,\n extendedAttributeReference: noop,\n};\n\nexport class Writer {\n constructor(ts) {\n this.ts = Object.assign({}, templates, ts);\n }\n\n /**\n * @param {string} raw\n * @param {object} options\n * @param {string} [options.unescaped]\n * @param {import(\"./productions/base.js\").Base} [options.context]\n * @returns\n */\n reference(raw, { unescaped, context }) {\n if (!unescaped) {\n unescaped = raw.startsWith(\"_\") ? raw.slice(1) : raw;\n }\n return this.ts.reference(raw, unescaped, context);\n }\n\n /**\n * @param {import(\"./tokeniser.js\").Token} t\n * @param {Function} wrapper\n * @param {...any} args\n * @returns\n */\n token(t, wrapper = noop, ...args) {\n if (!t) {\n return \"\";\n }\n const value = wrapper(t.value, ...args);\n return this.ts.wrap([this.ts.trivia(t.trivia), value]);\n }\n\n reference_token(t, context) {\n return this.token(t, this.reference.bind(this), { context });\n }\n\n name_token(t, arg) {\n return this.token(t, this.ts.name, arg);\n }\n\n identifier(id, context) {\n return this.ts.wrap([\n this.reference_token(id.tokens.value, context),\n this.token(id.tokens.separator),\n ]);\n }\n}\n\nexport function write(ast, { templates: ts = templates } = {}) {\n ts = Object.assign({}, templates, ts);\n\n const w = new Writer(ts);\n\n return ts.wrap(ast.map((it) => it.write(w)));\n}\n","import { validationError as error } from \"./error.js\";\n\nfunction getMixinMap(all, unique) {\n const map = new Map();\n const includes = all.filter((def) => def.type === \"includes\");\n for (const include of includes) {\n const mixin = unique.get(include.includes);\n if (!mixin) {\n continue;\n }\n const array = map.get(include.target);\n if (array) {\n array.push(mixin);\n } else {\n map.set(include.target, [mixin]);\n }\n }\n return map;\n}\n\n/**\n * @typedef {ReturnType<typeof groupDefinitions>} Definitions\n */\nfunction groupDefinitions(all) {\n const unique = new Map();\n const duplicates = new Set();\n const partials = new Map();\n for (const def of all) {\n if (def.partial) {\n const array = partials.get(def.name);\n if (array) {\n array.push(def);\n } else {\n partials.set(def.name, [def]);\n }\n continue;\n }\n if (!def.name) {\n continue;\n }\n if (!unique.has(def.name)) {\n unique.set(def.name, def);\n } else {\n duplicates.add(def);\n }\n }\n return {\n all,\n unique,\n partials,\n duplicates,\n mixinMap: getMixinMap(all, unique),\n cache: {\n typedefIncludesDictionary: new WeakMap(),\n dictionaryIncludesRequiredField: new WeakMap(),\n },\n };\n}\n\nfunction* checkDuplicatedNames({ unique, duplicates }) {\n for (const dup of duplicates) {\n const { name } = dup;\n const message = `The name \"${name}\" of type \"${\n unique.get(name).type\n }\" was already seen`;\n yield error(dup.tokens.name, dup, \"no-duplicate\", message);\n }\n}\n\nfunction* validateIterable(ast) {\n const defs = groupDefinitions(ast);\n for (const def of defs.all) {\n if (def.validate) {\n yield* def.validate(defs);\n }\n }\n yield* checkDuplicatedNames(defs);\n}\n\n// Remove this once all of our support targets expose `.flat()` by default\nfunction flatten(array) {\n if (array.flat) {\n return array.flat();\n }\n return [].concat(...array);\n}\n\n/**\n * @param {import(\"./productions/base.js\").Base[]} ast\n * @return {import(\"./error.js\").WebIDLErrorData[]} validation errors\n */\nexport function validate(ast) {\n return [...validateIterable(flatten(ast))];\n}\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v4.2.12 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction merge(obj) {\n let i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n}\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = merge({}, block);\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = merge({}, block.normal, {\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n});\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = merge({}, block.normal, {\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = merge({}, inline);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = merge({}, inline.normal, {\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = merge({}, inline.normal, {\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n});\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n});\n\n/**\n * smartypants text replacement\n * @param {string} text\n */\nfunction smartypants(text) {\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n}\n\n/**\n * mangle email addresses\n * @param {string} text\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${level}>\\n`;\n }\n\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `<li>${text}</li>\\n`;\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `<tbody>${body}</tbody>`;\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n function onError(e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n\n try {\n const tokens = Lexer.lex(src, opt);\n if (opt.walkTokens) {\n if (opt.async) {\n return Promise.all(marked.walkTokens(tokens, opt.walkTokens))\n .then(() => {\n return Parser.parse(tokens, opt);\n })\n .catch(onError);\n }\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parse(tokens, opt);\n } catch (e) {\n onError(e);\n }\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n merge(marked.defaults, opt);\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = merge({}, pack);\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = function(src, opt) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked.parseInline(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked.parseInline(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n try {\n const tokens = Lexer.lexInline(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n return Parser.parseInline(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n};\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: #193766;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: white;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/w3c/group.js\"),\n import(\"../src/w3c/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/w3c/style.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/w3c/level.js\"),\n import(\"../src/w3c/headers.js\"),\n import(\"../src/w3c/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/w3c/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/tables.js\"),\n import(\"../src/core/webidl.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/xref.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/dfn-index.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/webidl-index.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/core/caniuse.js\"),\n import(\"../src/core/mdn-annotation.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/search-xref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/w3c/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/webidl-clipboard.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/web-monetization.js\"),\n import(\"../src/core/before-save.js\"),\n /* Linters must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/check-internal-slots.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-captionless-tables.js\"),\n import(\"../src/core/linter-rules/no-unused-dfns.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/w3c/linter-rules/required-sections.js\"),\n import(\"../src/core/linter-rules/wpt-tests-exist.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n import(\"../src/core/linter-rules/a11y.js\"),\n import(\"../src/core/linter-rules/informative-dfn.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * @module w3c/group\n *\n * `group` is a shorthand configuration option for specifying `wg`, `wgId`,\n * `wgURI`, and `wgPatentURI` options.\n */\n\nimport { docLink, fetchAndCache, showError } from \"../core/utils.js\";\n\nexport const name = \"w3c/group\";\n\nconst W3C_GROUPS_API = \"https://respec.org/w3c/groups/\";\nexport async function run(conf) {\n if (!conf.group) {\n return;\n }\n\n const { group } = conf;\n const groupDetails = Array.isArray(group)\n ? await getMultipleGroupDetails(group)\n : await getGroupDetails(group);\n Object.assign(conf, groupDetails);\n}\n\n/** @param {string[]} groups */\nasync function getMultipleGroupDetails(groups) {\n const details = await Promise.all(groups.map(getGroupDetails));\n /** @type {{ [key in keyof GroupDetails]: GroupDetails[key][] }} */\n const result = {\n wg: [],\n wgId: [],\n wgURI: [],\n wgPatentURI: [],\n wgPatentPolicy: [],\n groupType: [],\n };\n for (const groupDetails of details.filter(o => o)) {\n for (const key of Object.keys(result)) {\n result[key].push(groupDetails[key]);\n }\n }\n return result;\n}\n\n/**\n * @param {string} group\n * @typedef {{ wgId: number, wg: string, wgURI: string, wgPatentURI: string, wgPatentPolicy: string, groupType: W3CGroupType }} GroupDetails\n * @returns {Promise<GroupDetails|undefined>}\n */\nasync function getGroupDetails(group) {\n let type = \"\";\n let shortname = group;\n if (group.includes(\"/\")) {\n [type, shortname] = group.split(\"/\", 2);\n }\n const url = new URL(`${shortname}/${type}`, W3C_GROUPS_API);\n const res = await fetchAndCache(url.href);\n if (res.ok) {\n const json = await res.json();\n const {\n id: wgId,\n name: wg,\n patentURI: wgPatentURI,\n patentPolicy: wgPatentPolicy,\n type: groupType,\n wgURI,\n } = json;\n return { wg, wgId, wgURI, wgPatentURI, wgPatentPolicy, groupType };\n }\n\n const text = await res.text();\n let message = `Failed to fetch group details (HTTP: ${res.status}).`;\n let hint;\n if (res.status === 409) {\n [message, hint] = text.split(\"\\n\", 2);\n } else if (res.status === 404) {\n hint = docLink`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${\"[group]\"} configuration option.`;\n }\n showError(message, name, { hint });\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} 이전 `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 以前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` 直到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () => html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n>\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n</svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { ISODate, W3CDate, getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\nimport { sub } from \"../../core/pubsubhub.js\";\n\nconst localizationStrings = {\n en: {\n archives: \"archives\",\n author: \"Author:\",\n authors: \"Authors:\",\n commit_history: \"Commit history\",\n edited_in_place: \"edited in place\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n feedback: \"Feedback:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n history: \"History:\",\n implementation_report: \"Implementation report:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n latest_recommendation: \"Latest Recommendation:\",\n message_topic: \"… message topic …\",\n more_details_about_this_doc: \"More details about this document\",\n multiple_alternates(plural) {\n return `This document is also available in ${\n plural ? \"these non-normative formats\" : \"this non-normative format\"\n }:`;\n },\n prev_editor_draft: \"Previous editor's draft:\",\n prev_recommendation: \"Previous Recommendation:\",\n prev_version: \"Previous version:\",\n publication_history: \"Publication history\",\n test_suite: \"Test suite:\",\n this_version: \"This version:\",\n with_subject_line: \"with subject line\",\n your_topic_here: \"YOUR TOPIC HERE\",\n },\n ko: {\n author: \"저자:\",\n authors: \"저자:\",\n editor: \"편집자:\",\n editors: \"편집자:\",\n former_editor: \"이전 편집자:\",\n former_editors: \"이전 편집자:\",\n latest_editors_draft: \"최신 편집 초안:\",\n latest_published_version: \"최신 버전:\",\n this_version: \"현재 버전:\",\n },\n zh: {\n author: \"作者:\",\n authors: \"作者:\",\n commit_history: \"Git提交历史\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n feedback: \"反馈:\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n history: \"历史:\",\n implementation_report: \"实现报告:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n latest_recommendation: \"最新发布的正式推荐标准:\",\n message_topic: \"… 邮件主题 …\",\n prev_editor_draft: \"上一版编辑草稿:\",\n prev_recommendation: \"上一版正式推荐标准:\",\n prev_version: \"上一版:\",\n test_suite: \"测试套件:\",\n this_version: \"本版本:\",\n },\n ja: {\n archives: \"アーカイブ\",\n author: \"著者:\",\n authors: \"著者:\",\n commit_history: \"更新履歴\",\n edited_in_place: \"改版なく更新\",\n editor: \"編者:\",\n editors: \"編者:\",\n feedback: \"フィードバック:\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n history: \"履歴:\",\n implementation_report: \"実装レポート:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n latest_recommendation: \"最新の勧告版:\",\n message_topic: \"… メール件名 …\",\n more_details_about_this_doc: \"この文書についてのより詳細\",\n prev_editor_draft: \"前回の編集用草案:\",\n prev_recommendation: \"前回の勧告版:\",\n prev_version: \"前回のバージョン:\",\n publication_history: \"公表履歴\",\n test_suite: \"テストスイート:\",\n this_version: \"このバージョン:\",\n with_subject_line: \"次の件名で\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n archives: \"archivos\",\n author: \"Autor:\",\n authors: \"Autores:\",\n commit_history: \"Historial de cambios\",\n edited_in_place: \"editado en lugar\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n feedback: \"Comentarios:\",\n former_editor: \"Antiguo editor:\",\n former_editors: \"Antiguos editores:\",\n history: \"Historia:\",\n implementation_report: \"Informe de implementación:\",\n latest_editors_draft: \"Última versión del editor:\",\n latest_published_version: \"Última versión publicada:\",\n latest_recommendation: \"Recomendación más reciente:\",\n message_topic: \"… detalles de mensaje …\",\n more_details_about_this_doc: \"Más detalles sobre este documento:\",\n publication_history: \"Historial de publicación\",\n prev_editor_draft: \"Última versión del editor:\",\n prev_recommendation: \"Última Recomendación:\",\n prev_version: \"Última versión:\",\n test_suite: \"Suite de pruebas:\",\n this_version: \"Esta versión:\",\n with_subject_line: \"con línea de asunto\",\n your_topic_here: \"TU SUJETO AQUÍ\",\n },\n de: {\n archives: \"Archiv\",\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n commit_history: \"Commit-Historie\",\n edited_in_place: \"zuletzt geändert am\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n feedback: \"Feedback:\",\n former_editor: \"Frühere Mitwirkende:\",\n former_editors: \"Frühere Mitwirkende:\",\n history: \"Verlauf:\",\n implementation_report: \"Umsetzungsbericht:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n latest_recommendation: \"Aktuellste Empfehlung:\",\n more_details_about_this_doc: \"Mehr Informationen über dieses Dokument\",\n multiple_alternates(plural) {\n return `Dieses Dokument ist ebenfalls in ${\n plural\n ? \"diesen nicht-normativen Formaten verfügbar\"\n : \"diesem nicht-normativen Format verfügbar\"\n }:`;\n },\n prev_editor_draft: \"Vorheriger Entwurf:\",\n prev_recommendation: \"Vorherige Empfehlung:\",\n prev_version: \"Vorherige Version:\",\n publication_history: \"Veröffentlichungsverlauf\",\n test_suite: \"Testumgebung:\",\n this_version: \"Diese Fassung:\",\n },\n};\nexport const l10n = getIntlData(localizationStrings);\n\nexport function getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default (conf, options) => {\n /**\n * After export, we let fixup.js handle the <details>.\n */\n sub(\"beforesave\", doc => {\n const details = doc.querySelector(\".head details\");\n details.open = true;\n });\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">${renderSpecTitle(conf)}</p>\n <details open=\"${localStorage.getItem(\"tr-metadata\") || \"true\"}\">\n <summary>${l10n.more_details_about_this_doc}</summary>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>`\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.historyURI || conf.github\n ? html`<dt>${l10n.history}</dt>\n ${conf.historyURI\n ? html`<dd>\n <a href=\"${conf.historyURI}\">${conf.historyURI}</a>\n </dd>`\n : \"\"}\n ${conf.github\n ? html`<dd>\n <a href=\"${conf.github.commitHistoryURL}\"\n >${l10n.commit_history}</a\n >\n </dd>`\n : \"\"}`\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>${l10n.test_suite}</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>${l10n.implementation_report}</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.prevED\n ? html`\n <dt>${l10n.prev_editor_draft}</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n ${conf.showPreviousVersion\n ? html`\n <dt>${l10n.prev_version}</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.prevRecURI\n ? \"\"\n : conf.isRec\n ? html`\n <dt>${l10n.prev_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `\n : html`\n <dt>${l10n.latest_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `}\n ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n ${conf.errata\n ? html`<dt>Errata:</dt>\n <dd><a href=\"${conf.errata}\">Errata exists</a>.</dd>`\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n </details>\n ${conf.isRec\n ? html`<p>\n See also\n <a\n href=\"${`https://www.w3.org/Translations/?technology=${conf.shortName}`}\"\n >\n <strong>translations</strong></a\n >.\n </p>`\n : \"\"}\n ${conf.alternateFormats\n ? html`<p>\n ${l10n.multiple_alternates(options.multipleAlternates)}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n\nexport function renderFeedback(conf) {\n const definitions = [];\n // Github feedback...\n if (conf.github) {\n const { repoURL, issuesURL, newIssuesURL, pullsURL, fullName } =\n conf.github;\n definitions.push(\n html`<dd>\n <a href=\"${repoURL}\">GitHub ${fullName}</a>\n (<a href=\"${pullsURL}\">pull requests</a>,\n <a href=\"${newIssuesURL}\">new issue</a>,\n <a href=\"${issuesURL}\">open issues</a>)\n </dd>`\n );\n }\n\n // The <a href=\"mailto:list?subject\"> link for the public list\n if (conf.wgPublicList) {\n const mailToURL = new URL(`mailto:${conf.wgPublicList}@w3.org`);\n const subject =\n conf.subjectPrefix ?? `[${conf.shortName}] ${l10n.your_topic_here}`;\n const mailingListLink = html`<a\n href=\"${mailToURL.href}?subject=${encodeURIComponent(subject)}\"\n >${mailToURL.pathname}</a\n >`;\n\n // The subject line...\n const subjectLine =\n conf.subjectPrefix ||\n html`[${conf.shortName}] <em>${l10n.message_topic}</em>`;\n const emailSubject = html`${l10n.with_subject_line}${\" \"}\n <kbd>${subjectLine}</kbd>`;\n\n // Archives link\n const archiveURL = new URL(\n conf.wgPublicList,\n \"https://lists.w3.org/Archives/Public/\"\n );\n const archiveLink = html`(<a href=\"${archiveURL}\" rel=\"discussion\"\n >${l10n.archives}</a\n >)`;\n\n definitions.push(\n html`<dd>${mailingListLink} ${emailSubject} ${archiveLink}</dd>`\n );\n }\n return definitions;\n}\n\nfunction renderSpecTitle(conf) {\n const specType = conf.isCR || conf.isCRY ? conf.longStatus : conf.textStatus;\n const preamble = conf.prependW3C\n ? html`<a href=\"https://www.w3.org/standards/types#${conf.specStatus}\"\n >W3C ${specType}</a\n >`\n : html`${specType}`;\n return html`${preamble}${\" \"}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >${conf.modificationDate\n ? html`, ${l10n.edited_in_place}${\" \"}\n <time\n class=\"dt-modified\"\n datetime=\"${ISODate.format(conf.modificationDate)}\"\n >${W3CDate.format(conf.modificationDate)}</time\n >`\n : \"\"}`;\n}\n\n/**\n * @param { LicenseInfo } licenseInfo license information\n */\nfunction linkLicense(licenseInfo) {\n const { url, short, name } = licenseInfo;\n if (name === \"unlicensed\") {\n return html`. <span class=\"issue\">THIS DOCUMENT IS UNLICENSED</span>.`;\n }\n return html` and\n <a rel=\"license\" href=\"${url}\" title=\"${name}\">${short}</a> rules apply.`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.isUnofficial && conf.licenseInfo) {\n return html`<p class=\"copyright\">\n Copyright ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n the document editors/authors.\n ${conf.licenseInfo.name !== \"unlicensed\"\n ? html`Text is available under the\n <a rel=\"license\" href=\"${conf.licenseInfo.url}\"\n >${conf.licenseInfo.name}</a\n >; additional terms may apply.`\n : \"\"}\n </p>`;\n }\n return renderOfficialCopyright(conf);\n}\n\nfunction renderOfficialCopyright(conf) {\n return html`<p class=\"copyright\">\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\"\n >Copyright</a\n >\n ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n <a href=\"https://www.w3.org/\">World Wide Web Consortium</a>.\n <abbr title=\"World Wide Web Consortium\">W3C</abbr><sup>®</sup>\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\"\n >liability</a\n >,\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\"\n >trademark</a\n >${linkLicense(conf.licenseInfo)}\n </p>`;\n}\n","// @ts-check\nimport { getSpecSubTitleElem, l10n, renderFeedback } from \"./headers.js\";\nimport { W3CDate } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nexport default (conf, options) => {\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n }\n\n const specTitleElem = document.querySelector(\"h1#title\");\n const specTitleElemClone = specTitleElem.cloneNode(true);\n\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${specTitleElem} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">\n <a href=\"https://www.w3.org/standards/types#reports\"\n >${conf.longStatus}</a\n >\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >\n </p>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>`\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>Test suite:</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>Implementation report:</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.prevVersion\n ? html`\n <dt>Previous version:</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.isCGFinal\n ? html`\n ${conf.prevED\n ? html`\n <dt>Previous editor's draft:</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n `\n : \"\"}\n ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n </dl>\n ${conf.alternateFormats\n ? html`<p>\n ${options.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${existingCopyright\n ? existingCopyright\n : html`<p class=\"copyright\">\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\"\n >Copyright</a\n >\n ©\n ${conf.copyrightStart\n ? `${conf.copyrightStart}-`\n : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n the Contributors to the ${specTitleElemClone.childNodes}\n Specification, published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a> under the\n ${conf.isCGFinal\n ? html`\n <a href=\"https://www.w3.org/community/about/agreements/fsa/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >. A human-readable\n <a\n href=\"https://www.w3.org/community/about/agreements/fsa-deed/\"\n >summary</a\n >\n is available.\n `\n : html`\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >. A human-readable\n <a\n href=\"https://www.w3.org/community/about/agreements/cla-deed/\"\n >summary</a\n >\n is available.\n `}\n </p>`}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n","// @ts-check\nimport { W3CDate, getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport { status2track } from \"../headers.js\";\nconst localizationStrings = {\n en: {\n sotd: \"Status of This Document\",\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. A list of current W3C\n publications and the latest revision of this technical report can be found\n in the <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> at\n https://www.w3.org/TR/.`,\n },\n ko: {\n sotd: \"현재 문서의 상태\",\n status_at_publication: html`이 부분은 현재 문서의 발행 당시 상태에 대해\n 기술합니다. W3C 발행 문서의 최신 목록 및 테크니컬 리포트 최신판을\n https://www.w3.org/TR/ 의\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> 에서\n 열람할 수 있습니다.`,\n },\n zh: {\n sotd: \"关于本文档\",\n // eslint-disable-next-line prettier/prettier\n status_at_publication: html`本章节描述了本文档的发布状态。W3C的文档列表和最新版本可通过<a href=\"https://www.w3.org/TR/\">W3C技术报告</a>索引访问。`,\n },\n ja: {\n sotd: \"この文書の位置付け\",\n status_at_publication: html`この節には、公開時点でのこの文書の位置づけが記されている。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a>\n (https://www.w3.org/TR/)`,\n },\n nl: {\n sotd: \"Status van dit document\",\n },\n es: {\n sotd: \"Estado de este Document\",\n status_at_publication: html`Esta sección describe el estado del presente\n documento al momento de su publicación. Una lista de las publicaciones\n actuales del W3C y la última revisión del presente informe técnico puede\n hallarse en http://www.w3.org/TR/\n <a href=\"https://www.w3.org/TR/\">el índice de informes técnicos</a> del\n W3C.`,\n },\n de: {\n sotd: \"Status dieses Dokuments\",\n status_at_publication: html`Dieser Abschnitt beschreibt den Status des\n Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen\n Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann\n im <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> unter\n https://www.w3.org/TR/ abgerufen werden.`,\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nconst processLink = \"https://www.w3.org/2021/Process-20211102/\";\n\nfunction prefix(word) {\n return /^[aeiou]/i.test(word) ? `an ${word}` : `a ${word}`;\n}\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n ${conf.isUnofficial\n ? renderIsUnofficial(opts)\n : conf.isTagFinding\n ? opts.additionalContent\n : conf.isNoTrack\n ? renderIsNoTrack(conf, opts)\n : html`\n <p><em>${l10n.status_at_publication}</em></p>\n ${conf.isMemberSubmission\n ? noteForSubmission(conf, opts)\n : html`\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.overrideStatus\n ? html` ${linkToWorkingGroup(conf)} `\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.isRec ? renderIsRec(conf) : renderNotRec(conf)}\n ${renderDeliverer(conf)}\n <p>\n This document is governed by the\n <a id=\"w3c_process_revision\" href=\"${processLink}\"\n >2 November 2021 W3C Process Document</a\n >.\n </p>\n `}\n `}\n ${opts.additionalSections}\n `;\n};\n\nexport function renderPreview(conf) {\n const { prUrl, prNumber, edDraftURI } = conf;\n return html`<details class=\"annoying-warning\" open=\"\">\n <summary>\n This is a\n preview${prUrl && prNumber\n ? html`\n of pull request\n <a href=\"${prUrl}\">#${prNumber}</a>\n `\n : \"\"}\n </summary>\n <p>\n Do not attempt to implement this version of the specification. Do not\n reference this version as authoritative in any way.\n ${edDraftURI\n ? html`\n Instead, see\n <a href=\"${edDraftURI}\">${edDraftURI}</a> for the Editor's draft.\n `\n : \"\"}\n </p>\n </details>`;\n}\n\nfunction renderIsUnofficial(opts) {\n const { additionalContent } = opts;\n return html`\n <p>\n This document is a draft of a potential specification. It has no official\n standing of any kind and does not represent the support or consensus of\n any standards organization.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderIsNoTrack(conf, opts) {\n const { isMO } = conf;\n const { additionalContent } = opts;\n return html`\n <p>\n This document is merely a W3C-internal\n ${isMO ? \"member-confidential\" : \"\"} document. It has no official standing\n of any kind and does not represent consensus of the W3C Membership.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderNotRec(conf) {\n let statusExplanation = null;\n let reviewPolicy = null;\n let endorsement = html`Publication as ${prefix(conf.textStatus)} does not\n imply endorsement by W3C and its Members.`;\n let updatePolicy = html`<p>\n This is a draft document and may be updated, replaced or obsoleted by other\n documents at any time. It is inappropriate to cite this document as other\n than work in progress.\n ${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>`;\n if (conf.specStatus === \"DISC\") {\n updatePolicy = html`<p>\n Publication as a Discontinued Draft implies that this document is no\n longer intended to advance or to be maintained. It is inappropriate to\n cite this document as other than abandoned work.\n </p>`;\n }\n const lsUpdatePolicy = html`<p>\n This document is maintained and updated at any time. Some parts of this\n document are work in progress.\n </p>`;\n switch (conf.specStatus) {\n case \"STMT\":\n endorsement = html`<p>\n A W3C Statement is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"RY\":\n endorsement = html`<p>W3C recommends the wide usage of this registry.</p>\n <p>\n A W3C Registry is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"CRD\":\n statusExplanation = html`A Candidate Recommendation Draft integrates\n changes from the previous Candidate Recommendation that the Working Group\n intends to include in a subsequent Candidate Recommendation Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRYD\":\n statusExplanation = html`A Candidate Registry Draft integrates changes\n from the previous Candidate Registry Snapshot that the Working Group\n intends to include in a subsequent Candidate Registry Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRY\":\n statusExplanation = html`A Candidate Registry Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>.`;\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${conf.humanPREnd}. Advisory\n Committee Representatives should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended ${conf.humanCREnd}.\n </p>`;\n break;\n case \"CR\":\n statusExplanation = html`A Candidate Recommendation Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>, is intended to\n gather\n <a href=\"${conf.implementationReportURI}\">implementation experience</a>,\n and has commitments from Working Group members to\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.`;\n updatePolicy = html`${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}`;\n if (conf.pubMode === \"LS\") {\n reviewPolicy = html`<p>\n Comments are welcome at any time but most especially before\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n } else {\n reviewPolicy = html`<p>\n This Candidate Recommendation is not expected to advance to Proposed\n Recommendation any earlier than ${W3CDate.format(conf.crEnd)}.\n </p>`;\n }\n break;\n case \"PR\":\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${W3CDate.format(conf.prEnd)}.\n Advisory Committee Representatives should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n break;\n case \"DNOTE\":\n case \"NOTE\":\n endorsement = html`${conf.textStatus}s are not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> nor its Members.`;\n break;\n }\n return html`<p>${endorsement} ${statusExplanation}</p>\n ${updatePolicy} ${reviewPolicy}`;\n}\n\nfunction renderIsRec(conf) {\n const { updateableRec, revisionTypes = [], revisedRecEnd } = conf;\n let reviewTarget = \"\";\n if (revisionTypes.includes(\"proposed-addition\")) {\n reviewTarget = \"additions\";\n } else if (revisionTypes.includes(\"proposed-correction\")) {\n reviewTarget = \"corrections\";\n }\n return html`\n <p>\n W3C recommends the wide deployment of this specification as a standard for\n the Web.\n </p>\n\n <p>\n A W3C Recommendation is a specification that, after extensive\n consensus-building, is endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members, and\n has commitments from Working Group members to\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.\n ${updateableRec\n ? html`Future updates to this Recommendation may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>\n ${revisionTypes.includes(\"addition\")\n ? html`<p class=\"addition\">\n Candidate additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"correction\")\n ? html`<p class=\"correction\">\n Candidate corrections are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"proposed-addition\")\n ? html`<p class=\"addition proposed\">\n Proposed additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"proposed-correction\")\n ? html`<p class=\"correction proposed\">\n Proposed corrections are marked in the document.\n </p>`\n : \"\"}\n ${reviewTarget\n ? html`<p>\n The W3C Membership and other interested parties are invited to review\n the proposed ${reviewTarget} and send comments through\n ${W3CDate.format(revisedRecEnd)}. Advisory Committee Representatives\n should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\n </p>`\n : \"\"}\n `;\n}\n\nfunction renderDeliverer(conf) {\n const {\n isNote,\n isRegistry,\n wgId,\n multipleWGs,\n wgPatentHTML,\n wgPatentURI,\n wgPatentPolicy,\n } = conf;\n\n const patentPolicyURL =\n wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/Consortium/Patent-Policy/\";\n\n const producers = !(isNote || isRegistry)\n ? html`\n This document was produced by ${multipleWGs ? \"groups\" : \"a group\"}\n operating under the\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >.\n `\n : html`\n The\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >\n does not carry any licensing requirements or commitments on this\n document.\n `;\n return html`<p data-deliverer=\"${isNote || isRegistry ? wgId : null}\">\n ${producers}\n ${!(isNote || isRegistry)\n ? html`\n ${multipleWGs\n ? html` W3C maintains ${wgPatentHTML} `\n : html`\n W3C maintains a\n <a href=\"${[wgPatentURI]}\" rel=\"disclosure\"\n >public list of any patent disclosures</a\n >\n `}\n made in connection with the deliverables of\n ${multipleWGs\n ? \"each group; these pages also include\"\n : \"the group; that page also includes\"}\n instructions for disclosing a patent. An individual who has actual\n knowledge of a patent which the individual believes contains\n <a href=\"${patentPolicyURL}#def-essential\">Essential Claim(s)</a>\n must disclose the information in accordance with\n <a href=\"${patentPolicyURL}#sec-Disclosure\"\n >section 6 of the W3C Patent Policy</a\n >.\n `\n : \"\"}\n </p>`;\n}\n\nfunction noteForSubmission(conf, opts) {\n return html`\n ${opts.additionalContent}\n ${conf.isMemberSubmission ? noteForMemberSubmission(conf) : \"\"}\n `;\n}\n\nfunction noteForMemberSubmission(conf) {\n const teamComment = `https://www.w3.org/Submission/${conf.publishDate.getUTCFullYear()}/${\n conf.submissionCommentNumber\n }/Comment/`;\n\n const patentPolicyURL =\n conf.wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/Consortium/Patent-Policy/\";\n\n return html`<p>\n By publishing this document, W3C acknowledges that the\n <a href=\"${conf.thisVersion}\">Submitting Members</a> have made a formal\n Submission request to W3C for discussion. Publication of this document by\n W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or\n will be allocating any resources to the issues addressed by it. This\n document is not the product of a chartered W3C group, but is published as\n potential input to the\n <a href=\"https://www.w3.org/Consortium/Process\">W3C Process</a>. A\n <a href=\"${teamComment}\">W3C Team Comment</a> has been published in\n conjunction with this Member Submission. Publication of acknowledged Member\n Submissions at the W3C site is one of the benefits of\n <a href=\"https://www.w3.org/Consortium/Prospectus/Joining\">\n W3C Membership</a\n >. Please consult the requirements associated with Member Submissions of\n <a href=\"${patentPolicyURL}#sec-submissions\"\n >section 3.3 of the W3C Patent Policy</a\n >. Please consult the complete\n <a href=\"https://www.w3.org/Submission\"\n >list of acknowledged W3C Member Submissions</a\n >.\n </p>`;\n}\n\nexport function renderPublicList(conf, opts) {\n const { mailToWGPublicListWithSubject, mailToWGPublicListSubscription } =\n opts;\n const { wgPublicList, subjectPrefix } = conf;\n const archivesURL = `https://lists.w3.org/Archives/Public/${wgPublicList}/`;\n return html`<p>\n If you wish to make comments regarding this document, please send them to\n <a href=\"${mailToWGPublicListWithSubject}\">${wgPublicList}@w3.org</a>\n (<a href=\"${mailToWGPublicListSubscription}\">subscribe</a>,\n <a href=\"${archivesURL}\">archives</a>)${subjectPrefix\n ? html` with <code>${subjectPrefix}</code> at the start of your email's\n subject`\n : \"\"}.\n </p>`;\n}\n\nfunction linkToWorkingGroup(conf) {\n if (!conf.wg) {\n return;\n }\n let changes = null;\n if (conf.isRec && conf.revisionTypes && conf.revisionTypes.length) {\n const pa = conf.revisionTypes.includes(\"proposed-addition\");\n const pc = conf.revisionTypes.includes(\"proposed-correction\");\n const ca = conf.revisionTypes.includes(\"addition\");\n const cc = conf.revisionTypes.includes(\"correction\");\n if ((pa && pc) || (ca && cc)) {\n changes = html`It includes\n ${pa\n ? html`<a href=\"${processLink}#proposed-amendments\">\n proposed amendments</a\n >`\n : html`<a href=\"${processLink}#candidate-amendments\">\n candidate amendments</a\n >`},\n introducing substantive changes and new features since the previous\n Recommendation.`;\n } else if (pa || ca) {\n changes = html`It includes\n ${pa\n ? html`<a href=\"${processLink}#proposed-addition\">\n proposed additions</a\n >`\n : html`<a href=\"${processLink}#candidate-addition\">\n candidate additions</a\n >`},\n introducing new features since the previous Recommendation.`;\n } else if (pc || cc) {\n changes = html`It includes\n ${pc\n ? html`<a href=\"${processLink}#proposed-correction\">\n proposed corrections</a\n >`\n : html`<a href=\"${processLink}#candidate-correction\">\n candidate corrections</a\n >`}.`;\n }\n }\n const track = status2track[conf.specStatus]\n ? html` using the\n <a href=\"${processLink}#recs-and-notes\"\n >${status2track[conf.specStatus]} track</a\n >`\n : \"\";\n return html`<p>\n This document was published by ${conf.wgHTML} as\n ${prefix(conf.longStatus)}${track}. ${changes}\n </p>`;\n}\n\nexport function linkToCommunity(conf, opts) {\n if (!conf.github && !conf.wgPublicList) {\n return;\n }\n return html`<p>\n ${conf.github\n ? html`\n <a href=\"${conf.issueBase}\">GitHub Issues</a> are preferred for\n discussion of this specification.\n `\n : \"\"}\n ${conf.wgPublicList\n ? html`\n ${conf.github && conf.wgPublicList\n ? \"Alternatively, you can send comments to our mailing list.\"\n : \"Comments regarding this document are welcome.\"}\n Please send them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a href=\"${opts.mailToWGPublicListSubscription}\">subscribe</a>,\n <a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html` with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject`\n : \"\"}.\n `\n : \"\"}\n </p>`;\n}\n","// @ts-check\nimport {\n l10n,\n linkToCommunity,\n renderPreview,\n renderPublicList,\n} from \"./sotd.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n <p>\n This specification was published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a>. It is not a W3C Standard nor is it\n on the W3C Standards Track.\n ${conf.isCGFinal\n ? html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/final/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >\n other conditions apply.\n `\n : html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >\n there is a limited opt-out and other conditions apply.\n `}\n Learn more about\n <a href=\"https://www.w3.org/community/\"\n >W3C Community and Business Groups</a\n >.\n </p>\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.github && conf.wgPublicList ? renderPublicList(conf, opts) : \"\"}\n ${conf.github ? linkToCommunity(conf, opts) : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${opts.additionalSections}\n `;\n};\n","// @ts-check\n// Module w3c/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - shortName: the small name that is used after /TR/ in published reports (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - previousPublishDate: the date on which the previous version was published.\n// - previousMaturity: the specStatus of the previous version\n// - errata: the URI of the errata document, if any\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - testSuiteURI: the URI to the test suite, if any\n// - implementationReportURI: the URI to the implementation report, if any\n// - noRecTrack: set to true if this document is not intended to be on the Recommendation track\n// - edDraftURI: the URI of the Editor's Draft for this document, if any. Required if\n// specStatus is set to \"ED\".\n// - additionalCopyrightHolders: a copyright owner in addition to W3C (or the only one if specStatus\n// is unofficial)\n// - copyrightStart: the year from which the copyright starts running\n// - prevED: the URI of the previous Editor's Draft if it has moved\n// - prevRecShortname: the short name of the previous Recommendation, if the name has changed\n// - prevRecURI: the URI of the previous Recommendation if not directly generated from\n// prevRecShortname.\n// - wg: the name of the WG in charge of the document. This may be an array in which case wgURI\n// and wgPatentURI need to be arrays as well, of the same length and in the same order\n// - wgURI: the URI to the group's page, or an array of such\n// - wgPatentURI: the URI to the group's patent information page, or an array of such. NOTE: this\n// is VERY IMPORTANT information to provide and get right, do not just paste this without checking\n// that you're doing it right\n// - wgPublicList: the name of the mailing list where discussion takes place. Note that this cannot\n// be an array as it is assumed that there is a single list to discuss the document, even if it\n// is handled by multiple groups\n// - charterDisclosureURI: used for IGs (when publishing IG-NOTEs) to provide a link to the IPR commitment\n// defined in their charter.\n// - thisVersion: the URI to the dated current version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - latestVersion: the URI to the latest version of the specification.\n// - prevVersion: the URI to the previous (dated) version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - subjectPrefix: the string that is expected to be used as a subject prefix when posting to the mailing\n// list of the group.\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by\", which is experimentally available in some groups (but likely to be phased out).\n// Note that this is a dual licensing regime.\n// - \"document\", which is the old, but still available, document license.\n// - \"dual\", dual license.\n// - \"cc0\", an extremely permissive license. It is only recommended if you are working on a document that is\n// intended to be pushed to the WHATWG.\n// - \"w3c-software\", a permissive and attributions license (but GPL-compatible).\n// - \"w3c-software-doc\", (default) the W3C Software and Document License\n// https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\nimport {\n ISODate,\n codedJoinAnd,\n codedJoinOr,\n concatDate,\n docLink,\n htmlJoinAnd,\n norm,\n showError,\n showWarning,\n} from \"../core/utils.js\";\nimport cgbgHeadersTmpl from \"./templates/cgbg-headers.js\";\nimport cgbgSotdTmpl from \"./templates/cgbg-sotd.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport sotdTmpl from \"./templates/sotd.js\";\n\nexport const name = \"w3c/headers\";\n\n/**\n * Resolves against https://www.w3.org.\n * @param {string} href\n */\nfunction w3Url(href) {\n return new URL(href, \"https://www.w3.org/\").href;\n}\n\nconst status2maturity = {\n LS: \"WD\",\n LD: \"WD\",\n FPWD: \"WD\",\n};\n\nexport const status2text = {\n DNOTE: \"Group Draft Note\",\n NOTE: \"Group Note\",\n STMT: \"Statement\",\n \"Member-SUBM\": \"Member Submission\",\n MO: \"Member-Only Document\",\n ED: \"Editor's Draft\",\n LS: \"Living Standard\",\n LD: \"Living Document\",\n FPWD: \"First Public Working Draft\",\n WD: \"Working Draft\",\n CR: \"Candidate Recommendation\",\n CRD: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n PER: \"Proposed Edited Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Discontinued Draft\",\n RSCND: \"Rescinded Recommendation\",\n DRY: \"Draft Registry\",\n CRYD: \"Candidate Registry\",\n CRY: \"Candidate Registry\",\n RY: \"Registry\",\n unofficial: \"Unofficial Draft\",\n UD: \"Unofficial Draft\",\n base: \"\",\n finding: \"TAG Finding\",\n \"draft-finding\": \"Draft TAG Finding\",\n \"editor-draft-finding\": \"Draft TAG Finding\",\n \"CG-DRAFT\": \"Draft Community Group Report\",\n \"CG-FINAL\": \"Final Community Group Report\",\n \"BG-DRAFT\": \"Draft Business Group Report\",\n \"BG-FINAL\": \"Final Business Group Report\",\n};\nconst status2long = {\n ...status2text,\n CR: \"Candidate Recommendation Snapshot\",\n CRD: \"Candidate Recommendation Draft\",\n CRY: \"Candidate Registry Snapshot\",\n CRYD: \"Candidate Registry Draft\",\n};\nexport const status2track = {\n DNOTE: \"Note\",\n NOTE: \"Note\",\n STMT: \"Note\",\n \"WG-NOTE\": \"Note\",\n \"IG-NOTE\": \"Note\",\n FPWD: \"Recommendation\",\n WD: \"Recommendation\",\n CR: \"Recommendation\",\n CRD: \"Recommendation\",\n PR: \"Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Recommendation\",\n RSCND: \"Recommendation\",\n DRY: \"Registry\",\n CRYD: \"Registry\",\n CRY: \"Registry\",\n RY: \"Registry\",\n};\nexport const W3CNotes = [\"DNOTE\", \"NOTE\", \"STMT\"];\nexport const recTrackStatus = [\n \"CR\",\n \"CRD\",\n \"DISC\",\n \"FPWD\",\n \"PER\",\n \"PR\",\n \"REC\",\n \"RSCND\",\n \"WD\",\n];\nexport const registryTrackStatus = [\"DRY\", \"CRY\", \"CRYD\", \"RY\"];\nexport const tagStatus = [\"draft-finding\", \"finding\", \"editor-draft-finding\"];\nexport const cgStatus = [\"CG-DRAFT\", \"CG-FINAL\"];\nexport const bgStatus = [\"BG-DRAFT\", \"BG-FINAL\"];\nexport const cgbgStatus = [...cgStatus, ...bgStatus];\nexport const trStatus = [\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n];\nexport const noTrackStatus = [\n \"base\",\n ...cgStatus,\n ...bgStatus,\n \"editor-draft-finding\",\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\n/** @type {Map<string, LicenseInfo>} */\nexport const licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"w3c-software\",\n {\n name: \"W3C Software Notice and License\",\n short: \"W3C Software\",\n url: \"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231\",\n },\n ],\n [\n \"w3c-software-doc\",\n {\n name: \"W3C Software and Document Notice and License\",\n short: \"permissive document license\",\n url: \"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"document\",\n {\n name: \"W3C Document License\",\n short: \"document use\",\n url: \"https://www.w3.org/Consortium/Legal/copyright-documents\",\n },\n ],\n [\n \"dual\",\n {\n name: \"W3C Dual License\",\n short: \"dual license\",\n url: \"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html\",\n },\n ],\n [\n undefined,\n {\n name: \"unlicensed\",\n url: null,\n short: \"UNLICENSED\",\n },\n ],\n]);\n\nconst patentPolicies = [\"PP2017\", \"PP2020\"];\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg = docLink`${prop} is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nfunction deriveLicenseInfo(conf) {\n let license = undefined;\n if (typeof conf.license === \"string\") {\n const lCaseLicense = conf.license.toLowerCase();\n if (!licenses.has(lCaseLicense)) {\n const msg = `The license \"\\`${conf.license}\\`\" is not supported.`;\n const choices = codedJoinOr(\n [...licenses.keys()].filter(k => k),\n {\n quotes: true,\n }\n );\n const hint = docLink`Please set\n ${\"[license]\"} to one of: ${choices}. If in doubt, remove \\`license\\` and let ReSpec pick one for you.`;\n showError(msg, name, { hint });\n } else {\n license = lCaseLicense;\n }\n }\n\n if (conf.isUnofficial && !license) {\n license = \"cc-by\";\n }\n\n // W3C docs can't be CC-BY or CC0\n if (!conf.isUnofficial && [\"cc-by\", \"cc0\"].includes(license)) {\n const msg = docLink`License \"\\`${conf.license}\\`\" is not allowed for W3C Specifications.`;\n const hint = docLink`Please set ${\"[license]\"} to \\`\"w3c-software-doc\"\\` instead.`;\n showError(msg, name, { hint });\n }\n const licenseInfo = licenses.get(license);\n return licenseInfo;\n}\n\nexport async function run(conf) {\n conf.isBasic = conf.specStatus === \"base\";\n conf.isCGBG = cgbgStatus.includes(conf.specStatus);\n conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith(\"G-FINAL\");\n conf.isCR = conf.specStatus === \"CR\" || conf.specStatus === \"CRD\";\n conf.isCRDraft = conf.specStatus === \"CRD\";\n conf.isCRY = conf.specStatus === \"CRY\" || conf.specStatus === \"CRYD\";\n conf.isEd = conf.specStatus === \"ED\";\n conf.isMemberSubmission = conf.specStatus === \"Member-SUBM\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = W3CNotes.includes(conf.specStatus);\n conf.isNoTrack = noTrackStatus.includes(conf.specStatus);\n conf.isPER = conf.specStatus === \"PER\";\n conf.isPR = conf.specStatus === \"PR\";\n conf.isRecTrack = recTrackStatus.includes(conf.specStatus);\n conf.isRec = conf.isRecTrack && conf.specStatus === \"REC\";\n conf.isRegistry = registryTrackStatus.includes(conf.specStatus);\n conf.isRegular = !conf.isCGBG && !conf.isBasic;\n conf.isTagEditorFinding = conf.specStatus === \"editor-draft-finding\";\n conf.isTagFinding = tagStatus.includes(conf.specStatus);\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.licenseInfo = deriveLicenseInfo(conf);\n conf.prependW3C = !conf.isBasic && !conf.isUnofficial;\n conf.longStatus = status2long[conf.specStatus];\n conf.textStatus = status2text[conf.specStatus];\n conf.showPreviousVersion = false;\n\n if (conf.isRegular && !conf.shortName) {\n const msg = docLink`The ${\"[shortName]\"} configuration option is required for this kind of document.`;\n const hint = docLink`Please set ${\"[shortName]\"} to a short name for the specification.`;\n showError(msg, name, { hint });\n }\n\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n if (conf.modificationDate) {\n conf.modificationDate = validateDateAndRecover(\n conf,\n \"modificationDate\",\n document.lastModified\n );\n }\n\n if (conf.isRecTrack && !conf.github && !conf.wgPublicList) {\n const msg =\n \"W3C Process requires a either a link to a public repository or mailing list.\";\n const hint = docLink`Use the ${\"[github]\"} configuration option to add a link to a repository. Alternatively use ${\"[wgPublicList]\"} to link to a mailing list.`;\n showError(msg, name, {\n hint,\n });\n }\n\n if (conf.isEd && !conf.edDraftURI) {\n const msg = docLink`Editor's Drafts should set ${\"[edDraftURI]\"} configuration option.`;\n const hint = docLink`Please set ${\"[edDraftURI]\"} to the URL of the Editor's Draft. Alternatively, use the set ${\"[github]\"} option, which automatically sets it for you.`;\n showWarning(msg, name, { hint });\n }\n\n const pubSpace = derivePubSpace(conf);\n if (pubSpace && !conf.thisVersion) {\n const maturity = status2maturity[conf.specStatus] || conf.specStatus;\n const { shortName, publishDate } = conf;\n const date = concatDate(publishDate);\n const docVersion = `${maturity}-${shortName}-${date}`;\n const year = [...trStatus, \"Member-SUBM\"].includes(conf.specStatus)\n ? `${publishDate.getUTCFullYear()}/`\n : \"\";\n conf.thisVersion = w3Url(`${pubSpace}/${year}${docVersion}/`);\n }\n\n if (conf.isEd) conf.thisVersion = conf.edDraftURI;\n if (conf.isCGBG) validateCGBG(conf);\n if (conf.latestVersion !== null) {\n conf.latestVersion = conf.latestVersion\n ? w3Url(conf.latestVersion)\n : w3Url(`${pubSpace}/${conf.shortName}/`);\n }\n\n if (conf.latestVersion) validateIfAllowedOnTR(conf);\n\n const latestPath = `${pubSpace}/${conf.shortName}`;\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n const msg = docLink`${\"[`previousPublishDate`]\"} is set, but missing ${\"[`previousMaturity`]\"}.`;\n showError(msg, name);\n }\n\n conf.previousPublishDate = validateDateAndRecover(\n conf,\n \"previousPublishDate\"\n );\n\n const prevMaturity =\n status2maturity[conf.previousMaturity] ?? conf.previousMaturity;\n if (conf.isTagFinding && conf.latestVersion) {\n const pubDate = ISODate.format(conf.publishDate);\n conf.thisVersion = w3Url(`${latestPath}-${pubDate}`);\n const prevPubDate = ISODate.format(conf.previousPublishDate);\n conf.prevVersion = w3Url(`${latestPath}-${prevPubDate}}`);\n } else if (conf.isCGBG || conf.isBasic) {\n conf.prevVersion = conf.prevVersion || \"\";\n } else {\n const year = conf.previousPublishDate.getUTCFullYear();\n const { shortName } = conf;\n const date = concatDate(conf.previousPublishDate);\n conf.prevVersion = w3Url(\n `${pubSpace}/${year}/${prevMaturity}-${shortName}-${date}/`\n );\n }\n }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = w3Url(`${pubSpace}/${conf.prevRecShortname}`);\n\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n\n if (conf.editors.length === 0) {\n const msg = \"At least one editor is required.\";\n const hint = docLink`Add one or more editors using the ${\"[editors]\"} configuration option.`;\n showError(msg, name, { hint });\n } else if (conf.editors.length && conf.isRecTrack) {\n // check that every editor has w3cid\n conf.editors.forEach((editor, i) => {\n if (editor.w3cid) return;\n const msg = docLink`Editor ${\n editor.name ? `\"${editor.name}\"` : `number ${i + 1}`\n } is missing their ${\"[w3cid]\"}.`;\n const hint = docLink`See ${\"[w3cid]\"} for instructions for how to retrieve it and add it.`;\n showError(msg, name, { hint });\n });\n }\n\n if (conf.alternateFormats?.some(({ uri, label }) => !uri || !label)) {\n const msg = docLink`Every ${\"[`alternateFormats`]\"} entry must have a \\`uri\\` and a \\`label\\`.`;\n showError(msg, name);\n }\n if (conf.copyrightStart == conf.publishYear) conf.copyrightStart = \"\";\n if (conf.isRec && !conf.errata && !conf.revisionTypes?.length) {\n const msg = \"Recommendations must have an errata link.\";\n const hint = docLink`Add an ${\"[errata]\"} URL to your ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n conf.shortISODate = ISODate.format(conf.publishDate);\n validatePatentPolicies(conf);\n await deriveHistoryURI(conf);\n if (conf.isTagEditorFinding) {\n delete conf.thisVersion;\n delete conf.latestVersion;\n }\n if (conf.isTagFinding) {\n conf.showPreviousVersion = conf.previousPublishDate ? true : false;\n }\n // configuration done - yay!\n\n const options = {\n get multipleAlternates() {\n return conf.alternateFormats && conf.alternateFormats.length > 1;\n },\n get alternatesHTML() {\n return (\n conf.alternateFormats &&\n htmlJoinAnd(\n // We need to pass a string here...\n conf.alternateFormats.map(({ label }) => label),\n (_, i) => {\n const alt = conf.alternateFormats[i];\n return html`<a\n rel=\"alternate\"\n href=\"${alt.uri}\"\n hreflang=\"${alt?.lang ?? null}\"\n type=\"${alt?.type ?? null}\"\n >${alt.label}</a\n >`;\n }\n )\n );\n },\n };\n\n // insert into document\n const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf, options);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // handle SotD\n const sotd =\n document.getElementById(\"sotd\") || document.createElement(\"section\");\n if ((conf.isCGBG || !conf.isNoTrack || conf.isTagFinding) && !sotd.id) {\n const msg =\n \"A Status of This Document must include at least on custom paragraph.\";\n const hint =\n \"Add a `<p>` in the 'sotd' section that reflects the status of this specification.\";\n showError(msg, name, { elements: [sotd], hint });\n }\n sotd.id = sotd.id || \"sotd\";\n sotd.classList.add(\"introductory\");\n // NOTE:\n // When arrays, wg and wgURI have to be the same length (and in the same order).\n // Technically wgURI could be longer but the rest is ignored.\n // However wgPatentURI can be shorter. This covers the case where multiple groups\n // publish together but some aren't used for patent policy purposes (typically this\n // happens when one is foolish enough to do joint work with the TAG). In such cases,\n // the groups whose patent policy applies need to be listed first, and wgPatentURI\n // can be shorter — but it still needs to be an array.\n const wgPotentialArray = [conf.wg, conf.wgURI, conf.wgPatentURI];\n if (\n wgPotentialArray.some(item => Array.isArray(item)) &&\n !wgPotentialArray.every(item => Array.isArray(item))\n ) {\n const msg = docLink`If one of ${\"[wg]\"}, ${\"[wgURI]\"}, or ${\"[wgPatentURI]\"} is an array, they all have to be.`;\n const hint = docLink`Use the ${\"[group]\"} option with an array instead.`;\n showError(msg, name, { hint });\n }\n if (Array.isArray(conf.wg)) {\n conf.multipleWGs = conf.wg.length > 1;\n conf.wgHTML = htmlJoinAnd(conf.wg, (wg, idx) => {\n return html`the <a href=\"${conf.wgURI[idx]}\">${wg}</a>`;\n });\n\n conf.wgPatentHTML = htmlJoinAnd(conf.wg, (wg, i) => {\n return html`a\n <a href=\"${conf.wgPatentURI[i]}\" rel=\"disclosure\"\n >public list of any patent disclosures (${wg})</a\n >`;\n });\n } else {\n conf.multipleWGs = false;\n if (conf.wg) {\n conf.wgHTML = html`the <a href=\"${conf.wgURI}\">${conf.wg}</a>`;\n }\n }\n if (conf.isPR && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"} (needed to indicate end of previous CR).`;\n showError(msg, name);\n }\n\n if (conf.isCR && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"CR\", but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.crEnd = validateDateAndRecover(conf, \"crEnd\");\n\n if (conf.isPr && !conf.prEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[prEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.prEnd = validateDateAndRecover(conf, \"prEnd\");\n\n if (conf.isPER && !conf.perEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PER\", but no ${\"[perEnd]\"} is specified.`;\n showError(msg, name);\n }\n conf.perEnd = validateDateAndRecover(conf, \"perEnd\");\n\n if (conf.hasOwnProperty(\"updateableRec\")) {\n const msg = \"Configuration option `updateableRec` is deprecated.\";\n const hint = docLink`Add an ${\"[`updateable-rec`|#updateable-rec-class]\"} CSS class to the Status of This Document section instead.`;\n showWarning(msg, name, { hint });\n if (conf.updateableRec) {\n sotd.classList.add(\"updateable-rec\");\n }\n }\n\n conf.updateableRec = sotd.classList.contains(\"updateable-rec\");\n const revisionTypes = [\n \"addition\",\n \"correction\",\n \"proposed-addition\",\n \"proposed-correction\",\n ];\n if (conf.isRec && conf.revisionTypes?.length > 0) {\n if (conf.revisionTypes.some(x => !revisionTypes.includes(x))) {\n const unknownRevisionTypes = conf.revisionTypes.filter(\n x => !revisionTypes.includes(x)\n );\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with unknown ${\"[revisionTypes]\"}: '${codedJoinOr(\n unknownRevisionTypes\n )}'.`;\n const hint = docLink`The valid values for ${\"[revisionTypes]\"} are: ${codedJoinOr(\n revisionTypes\n )}.`;\n showError(msg, name, { hint });\n }\n if (\n (conf.revisionTypes.includes(\"proposed-addition\") ||\n conf.revisionTypes.includes(\"addition\")) &&\n !conf.updateableRec\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed additions but the Recommendation is not marked as allowing new features.`;\n showError(msg, name);\n }\n }\n\n if (\n conf.specStatus === \"REC\" &&\n conf.updateableRec &&\n conf.revisionTypes &&\n conf.revisionTypes.length > 0 &&\n [\"proposed-addition\", \"proposed-correction\"].some(type =>\n conf.revisionTypes.includes(type)\n ) &&\n !conf.revisedRecEnd\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed corrections or additions but no ${\"[revisedRecEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.revisedRecEnd = validateDateAndRecover(conf, \"revisedRecEnd\");\n\n if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) {\n const msg = docLink`Document configured as ${\"[noRecTrack]\"}, but its status (\"${\n conf.specStatus\n }\") puts it on the W3C Rec Track.`;\n const notAllowed = codedJoinOr(recTrackStatus, { quotes: true });\n const hint = `Status **can't** be any of: ${notAllowed}.`;\n showError(msg, name, { hint });\n }\n if (!sotd.classList.contains(\"override\")) {\n html.bind(sotd)`${populateSoTD(conf, sotd)}`;\n }\n\n if (!conf.implementationReportURI && conf.isCR) {\n const msg = docLink`Missing ${\"[implementationReportURI]\"} configuration option in ${\"[respecConfig]\"}.`;\n const hint = docLink`CR documents must have an ${\"[implementationReportURI]\"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;\n showError(msg, name, { hint });\n }\n if (!conf.implementationReportURI && conf.isPR) {\n const msg = docLink`PR documents should include an ${\"[implementationReportURI]\"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;\n showWarning(msg, name);\n }\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: norm(\n document.getElementById(\"w3c-state\")?.textContent ?? \"\"\n ),\n });\n}\n\nfunction validateIfAllowedOnTR(conf) {\n const latestVersionURL = new URL(conf.latestVersion);\n const isW3C =\n latestVersionURL.origin === \"https://www.w3.org\" ||\n latestVersionURL.origin === \"https://w3.org/\";\n if (\n isW3C &&\n latestVersionURL.pathname.startsWith(\"/TR/\") &&\n [\"ED\", ...trStatus].includes(conf.specStatus) === false\n ) {\n const msg = docLink`Documents with a status of \\`\"${conf.specStatus}\"\\` can't be published on the W3C's /TR/ (Technical Report) space.`;\n const hint = docLink`Ask a W3C Team Member for a W3C URL where the report can be published and change ${\"[latestVersion]\"} to something else.`;\n showError(msg, name, { hint });\n return;\n }\n}\n\nfunction derivePubSpace(conf) {\n const { specStatus, group } = conf;\n if (trStatus.includes(specStatus) || conf.groupType === \"wg\") {\n return `/TR`;\n }\n\n switch (specStatus) {\n case \"CG-FINAL\":\n case \"BG-FINAL\":\n return `/community/reports/${group}`;\n case \"finding\":\n case \"draft-finding\":\n return \"/2001/tag/doc\";\n case \"Member-SUBM\":\n return `/Submission`;\n }\n\n return \"\";\n}\n\nfunction validateCGBG(conf) {\n const reportType = status2text[conf.specStatus];\n const latestVersionURL = conf.latestVersion\n ? new URL(w3Url(conf.latestVersion))\n : null;\n\n if (!conf.wg) {\n const msg = docLink`The ${\"[group]\"} configuration option is required for this kind of document (${reportType}).`;\n showError(msg, name);\n return;\n }\n\n // Deal with final reports\n if (conf.isCGFinal) {\n // Final report require a w3.org URL.\n const isW3C =\n latestVersionURL?.origin === \"https://www.w3.org\" ||\n latestVersionURL?.origin === \"https://w3.org/\";\n if (isW3C === false) {\n const msg = docLink`For ${reportType}, the ${\"[latestVersion]\"} URL must point to somewhere at https://www.w3.org/.`;\n const hint = `Ask a W3C Team Member for a W3C URL where the report can be published.`;\n showError(msg, name, { hint });\n return;\n }\n }\n}\n\nasync function deriveHistoryURI(conf) {\n if (!conf.shortName || conf.historyURI === null || !conf.latestVersion) {\n return; // Nothing to do\n }\n\n const canShowHistory = conf.isEd || trStatus.includes(conf.specStatus);\n\n if (conf.historyURI && !canShowHistory) {\n const msg = docLink`The ${\"[historyURI]\"} can't be used with non /TR/ documents.`;\n const hint = docLink`Please remove ${\"[historyURI]\"}.`;\n showError(msg, name, { hint });\n conf.historyURI = null;\n return;\n }\n\n const historyURL = new URL(\n conf.historyURI ?? conf.shortName,\n \"https://www.w3.org/standards/history/\"\n );\n\n // If it's on the Rec Track or it's TR worthy, then allow history override.\n // Also make a an exception for FPWD, DNOTE, NOTE and DRY.\n if (\n (conf.historyURI && canShowHistory) ||\n [\"FPWD\", \"DNOTE\", \"NOTE\", \"DRY\"].includes(conf.specStatus)\n ) {\n conf.historyURI = historyURL.href;\n return;\n }\n\n // Let's get the history from the W3C.\n // Do a fetch HEAD request to see if the history exists...\n // We don't discriminate... if it's on the W3C website with a history,\n // we show it.\n try {\n const response = await fetch(historyURL, { method: \"HEAD\" });\n if (response.ok) {\n conf.historyURI = response.url;\n }\n } catch {\n // Ignore fetch errors\n }\n}\n\nfunction validatePatentPolicies(conf) {\n if (!conf.wgPatentPolicy) return;\n const policies = new Set([].concat(conf.wgPatentPolicy));\n if (\n policies.size &&\n ![...policies].every(policy => patentPolicies.includes(policy))\n ) {\n const invalidPolicies = [...policies].filter(\n policy => !patentPolicies.includes(policy)\n );\n const msg = docLink`Invalid ${\"[wgPatentPolicy]\"} value(s): ${codedJoinAnd(\n invalidPolicies\n )}.`;\n const hint = `Please use one of: ${codedJoinOr(patentPolicies)}.`;\n showError(msg, name, { hint });\n }\n if (policies.size !== 1) {\n const msg =\n \"When collaborating across multiple groups, they must use the same patent policy.\";\n const hint = docLink`For ${\"[wgPatentPolicy]\"}, please check the patent policies of each group. The patent policies were: ${[\n ...policies,\n ].join(\", \")}.`;\n showError(msg, name, { hint });\n }\n // We take the first policy\n conf.wgPatentPolicy = [...policies][0];\n}\n\n/**\n * @param {*} conf\n * @param {HTMLElement} sotd\n */\nfunction populateSoTD(conf, sotd) {\n const options = {\n ...collectSotdContent(sotd, conf),\n\n get mailToWGPublicList() {\n return `mailto:${conf.wgPublicList}@w3.org`;\n },\n get mailToWGPublicListWithSubject() {\n const fragment = conf.subjectPrefix\n ? `?subject=${encodeURIComponent(conf.subjectPrefix)}`\n : \"\";\n return this.mailToWGPublicList + fragment;\n },\n get mailToWGPublicListSubscription() {\n return `mailto:${conf.wgPublicList}-request@w3.org?subject=subscribe`;\n },\n };\n const template = conf.isCGBG ? cgbgSotdTmpl : sotdTmpl;\n return template(conf, options);\n}\n\n/**\n * @param {HTMLElement} sotd\n */\nfunction collectSotdContent(sotd, { isTagFinding = false }) {\n const sotdClone = sotd.cloneNode(true);\n const additionalContent = document.createDocumentFragment();\n // we collect everything until we hit a section,\n // that becomes the custom content.\n while (sotdClone.hasChildNodes()) {\n if (\n sotdClone.nodeType === Node.ELEMENT_NODE &&\n // @ts-ignore\n sotdClone.firstChild.localName === \"section\"\n ) {\n break;\n }\n additionalContent.appendChild(sotdClone.firstChild);\n }\n if (isTagFinding && !additionalContent.hasChildNodes()) {\n const msg = docLink`ReSpec does not support automated SotD generation for TAG findings.`;\n const hint = `Please add the prerequisite content in the 'sotd' section.`;\n showWarning(msg, name, { hint });\n }\n return {\n additionalContent,\n // Whatever sections are left, we throw at the end.\n additionalSections: sotdClone.childNodes,\n };\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for W3C specs\n */\nexport const name = \"w3c/defaults\";\nimport {\n W3CNotes,\n bgStatus,\n cgStatus,\n recTrackStatus,\n registryTrackStatus,\n status2text,\n tagStatus,\n trStatus,\n} from \"./headers.js\";\nimport { codedJoinOr, docLink, showError } from \"../core/utils.js\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst w3cLogo = {\n src: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n alt: \"W3C\",\n height: 48,\n width: 72,\n url: \"https://www.w3.org/\",\n};\n\nconst memSubmissionLogo = {\n alt: \"W3C Member Submission\",\n href: \"https://www.w3.org/Submission/\",\n src: \"https://www.w3.org/Icons/member_subm-v.svg\",\n width: \"211\",\n height: \"48\",\n};\n\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": false,\n \"required-sections\": true,\n \"wpt-tests-exist\": false,\n \"informative-dfn\": \"warn\",\n \"no-unused-dfns\": \"warn\",\n a11y: false,\n },\n doJsonLd: false,\n logos: [],\n xref: true,\n wgId: \"\",\n otherLinks: [],\n excludeGithubLinks: true,\n subtitle: \"\",\n prevVersion: \"\",\n formerEditors: [],\n editors: [],\n authors: [],\n};\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...w3cDefaults.lint,\n ...conf.lint,\n };\n\n Object.assign(conf, {\n ...coreDefaults,\n ...w3cDefaults,\n ...conf,\n lint,\n });\n\n if (conf.specStatus !== \"unofficial\" && !conf.hasOwnProperty(\"license\")) {\n conf.license = \"w3c-software-doc\";\n }\n\n validateStatusForGroup(conf);\n processLogos(conf);\n}\n\nfunction processLogos(conf) {\n // Primarily include the W3C logo and license for W3C Recommendation track\n // that have an actual working group.\n const { specStatus, wg } = conf;\n const isWgStatus = [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n ...tagStatus,\n \"ED\",\n ].includes(specStatus);\n const inWorkingGroup = wg && wg.length && isWgStatus;\n // Member submissions don't need to be in a Working Group.\n const doesNotNeedWG = [\"Member-SUBM\"].includes(specStatus);\n const canShowW3CLogo = inWorkingGroup || doesNotNeedWG;\n if (canShowW3CLogo) {\n conf.logos.unshift(w3cLogo);\n if (specStatus === \"Member-SUBM\") {\n conf.logos.push(memSubmissionLogo);\n }\n }\n}\n\nfunction validateStatusForGroup(conf) {\n const { specStatus, groupType, group } = conf;\n\n if (!specStatus) {\n const msg = docLink`The ${\"[specStatus]\"} configuration option is required.`;\n const hint = docLink`Select an appropriate status from ${\"[specStatus]\"} based on your W3C group. If in doubt, use \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n if (status2text[specStatus] === undefined) {\n const msg = docLink`The ${\"[specStatus]\"} \"\\`${specStatus}\\`\" is not supported at for this type of document.`;\n const choices = codedJoinOr(Object.keys(status2text), { quotes: true });\n const hint = docLink`set ${\"[specStatus]\"} to one of: ${choices}.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n switch (groupType) {\n case \"cg\": {\n if (![...cgStatus, \"unofficial\", \"UD\"].includes(specStatus)) {\n const msg = docLink`W3C Community Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(cgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"CG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"CG-DRAFT\";\n }\n break;\n }\n case \"bg\": {\n if (![...bgStatus, \"unofficial\", \"UD\"].includes(specStatus)) {\n const msg = docLink`W3C Business Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(bgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"BG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"BG-DRAFT\";\n }\n break;\n }\n case \"wg\": {\n if (![...trStatus, \"unofficial\", \"UD\", \"ED\"].includes(specStatus)) {\n const msg = docLink`W3C Working Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const hint = docLink`Pleas see ${\"[specStatus]\"} for appropriate status for W3C Working Group documents.`;\n showError(msg, name, { hint });\n }\n break;\n }\n case \"other\":\n if (\n group === \"tag\" &&\n ![\"ED\", ...trStatus, ...tagStatus].includes(specStatus)\n ) {\n const msg = docLink`The W3C Technical Architecture Group's documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr([\"ED\", ...trStatus, ...tagStatus], {\n quotes: true,\n });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"unofficial\";\n }\n break;\n default:\n if (\n !conf.wgId &&\n ![\"unofficial\", \"base\", \"UD\", \"Member-SUBM\"].includes(conf.specStatus)\n ) {\n const msg =\n \"Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.\";\n const hint = docLink`Use the ${\"[group]\"} configuration option to associated this document with a W3C group.`;\n conf.specStatus = \"base\";\n showError(msg, name, { hint });\n }\n }\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module w3c/style\n// Inserts a link to the appropriate W3C style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { createResourceHint, linkCSS } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"w3c/style\";\n\nfunction attachFixupScript() {\n const script = html`<script src=\"https://www.w3.org/scripts/TR/2021/fixup.js\">`;\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n document.body.appendChild(script);\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2021/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2021/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all specs show the logo.\n href: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n as: \"image\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(html`<link\n rel=\"stylesheet\"\n href=\"https://www.w3.org/StyleSheets/TR/2021/base.css\"\n class=\"removeOnSave\"\n/>`);\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(\n html`<meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"\n />`\n );\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n const canonicalStatus = conf.specStatus?.toUpperCase() ?? \"\";\n let styleFile = \"\";\n const canUseW3CStyle =\n [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n \"ED\",\n \"MEMBER-SUBM\",\n ].includes(canonicalStatus) && conf.wgId;\n\n // Figure out which style file to use.\n switch (canonicalStatus) {\n case \"WD\":\n case \"FPWD\":\n styleFile = canUseW3CStyle ? \"W3C-WD\" : \"base.css\";\n break;\n case \"CG-DRAFT\":\n case \"CG-FINAL\":\n case \"BG-DRAFT\":\n case \"BG-FINAL\":\n styleFile = canonicalStatus.toLowerCase();\n break;\n case \"UD\":\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"FINDING\":\n case \"DRAFT-FINDING\":\n case \"EDITOR-DRAFT-FINDING\":\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n default:\n styleFile = canUseW3CStyle ? `W3C-${conf.specStatus}` : \"base.css\";\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\"end-all\", attachFixupScript, { once: true });\n }\n const finalStyleURL = new URL(\n `/StyleSheets/TR/2021/${styleFile}`,\n \"https://www.w3.org/\"\n );\n linkCSS(document, finalStyleURL.href);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"无标题\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","/**\n * This module updates the title and shortName\n * of a spec when there is a valid level configuration.\n *\n * Levels should be integers >= 0.\n */\n\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"w3c/level\";\n\nconst localizationStrings = {\n en: {\n level: \"Level\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.hasOwnProperty(\"level\")) return;\n\n const h1Elem = document.querySelector(\"h1#title\");\n\n const level = parseInt(conf.level);\n if (!Number.isInteger(level) || level < 0) {\n const msg = `The \\`level\\` configuration option must be a number greater or equal to 0. It is currently set to \\`${level}\\``;\n const title = \"Invalid level config.\";\n showError(msg, name, { title, elements: [h1Elem] });\n return;\n }\n\n h1Elem.append(` ${l10n.level} ${level}`);\n document.title = `${document.title} ${l10n.level} ${level}`;\n conf.shortName = `${conf.shortName}-${level}`;\n conf.level = level;\n}\n","// @ts-check\n// Module w3c/abstract\n// Handle the abstract section properly.\nimport { getIntlData, norm, renameElement, showError } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nexport const name = \"w3c/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n ko: {\n abstract: \"요약\",\n },\n zh: {\n abstract: \"摘要\",\n },\n ja: {\n abstract: \"要約\",\n },\n nl: {\n abstract: \"Samenvatting\",\n },\n es: {\n abstract: \"Resumen\",\n },\n de: {\n abstract: \"Zusammenfassung\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abstract = findAbstract();\n if (!abstract) {\n const msg = 'Document must have one `<section id=\"abstract\">`.';\n showError(msg, name);\n return;\n }\n abstract.classList.add(\"introductory\");\n abstract.id = \"abstract\";\n if (!abstract.querySelector(\"h2\")) {\n abstract.prepend(html`<h2>${l10n.abstract}</h2>`);\n }\n}\n\nfunction findAbstract() {\n /** @type {HTMLElement} */\n const abstract = document.querySelector(\"#abstract\");\n if (abstract) {\n switch (abstract.localName) {\n case \"section\":\n return abstract;\n case \"div\":\n // Legacy documents may use a div\n return renameElement(abstract, \"section\");\n default:\n showError(\"The abstract should be a `<section>` element.\", name, {\n elements: [abstract],\n });\n return abstract;\n }\n }\n\n // Let's try find it by checking the headings.\n // This can happen if the document was generated\n // using markdown.\n const searchString = l10n.abstract.toLowerCase();\n for (const header of document.querySelectorAll(\"h2, h3, h4, h5, h6\")) {\n const contents = norm(header.textContent).toLowerCase();\n if (contents === searchString) {\n return header.closest(\"section\");\n }\n }\n return null;\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"참조\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY?\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module w3c/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"w3c/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die Schlüsselwörter\" : \"Das Schlüsselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemäß\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter Berücksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groß geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before {\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n// Module core/tables\n// Handles tables in the document.\n// Generates a List of Tables wherever there is a #list-of-tables element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/tables\";\n\nconst localizationStrings = {\n en: {\n list_of_tables: \"List of Tables\",\n table: \"Table \",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const listOfTables = collectTables();\n const listOfTablesElement = document.querySelector(\"section#list-of-tables\");\n if (listOfTables.length && listOfTablesElement) {\n decorateListOfTables(listOfTablesElement);\n listOfTablesElement.append(\n html`<h1>${l10n.list_of_tables}</h1>`,\n html`<ul class=\"list-of-tables\">\n ${listOfTables}\n </ul>`\n );\n }\n}\n\n/**\n * process all tables\n */\nfunction collectTables() {\n /** @type {HTMLLIElement[]} */\n const listOfTables = [];\n /** @type {NodeListOf<HTMLTableElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n [...tables]\n // there is a separate linter rule to catch numbered tables without captions\n .filter(table => !!table.querySelector(\"caption\"))\n .forEach((table, i) => {\n const caption = table.querySelector(\"caption\");\n decorateTable(table, caption, i);\n listOfTables.push(getListOfTablesListItem(table.id, caption));\n });\n return listOfTables;\n}\n\n/**\n * @param {HTMLTableElement} table\n * @param {HTMLTableCaptionElement} caption\n * @param {number} i\n */\nfunction decorateTable(table, caption, i) {\n const title = caption.textContent;\n addId(table, \"table\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"table-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${table.id}\"\n >${l10n.table}<bdi class=\"tableno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} tableId\n * @param {HTMLTableCaptionElement} caption\n * @return {HTMLLIElement}\n */\nfunction getListOfTablesListItem(tableId, caption) {\n const listOfTablesCaption = caption.cloneNode(true);\n for (const anchor of listOfTablesCaption.querySelectorAll(\"a\")) {\n renameElement(anchor, \"span\", { copyAttributes: false });\n }\n return html`<li>\n <a class=\"tocxref\" href=\"${`#${tableId}`}\"\n >${listOfTablesCaption.childNodes}</a\n >\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} listOfTablesElement\n */\nfunction decorateListOfTables(listOfTablesElement) {\n if (\n listOfTablesElement.matches(\".appendix, .introductory\") ||\n listOfTablesElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(listOfTablesElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n listOfTablesElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n listOfTablesElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\nimport { definitionMap, registerDefinition } from \"./dfn-map.js\";\nimport { showError, wrapInner } from \"./utils.js\";\n\nconst topLevelEntities = new Set([\n \"callback interface\",\n \"callback\",\n \"dictionary\",\n \"enum\",\n \"interface mixin\",\n \"interface\",\n \"typedef\",\n]);\n\n/**\n * This function looks for a <dfn> element whose title is 'name' and\n * that is \"for\" 'parent', which is the empty string when 'name'\n * refers to a top-level entity. For top-level entities, <dfn>\n * elements that inherit a non-empty [dfn-for] attribute are also\n * counted as matching.\n *\n * When a matching <dfn> is found, it's given <code> formatting,\n * marked as an IDL definition, and returned. If no <dfn> is found,\n * the function returns 'undefined'.\n * @param {*} defn\n * @param {string} name\n */\nexport function findDfn(defn, name, { parent = \"\" } = {}) {\n switch (defn.type) {\n case \"constructor\":\n case \"operation\":\n return findOperationDfn(defn, parent, name);\n default:\n return findNormalDfn(defn, parent, name);\n }\n}\n\n/**\n * @param {{ type: string, arguments: any[] }} idlAst\n * @param {string} parent\n * @param {string} name\n */\nfunction getAlternativeNames(idlAst, parent, name) {\n const { type } = idlAst;\n const asQualifiedName = `${parent}.${name}`;\n switch (type) {\n case \"constructor\":\n case \"operation\": {\n // Allow linking to \"method()\", method(arg) and \"method\" name.\n const asMethodName = `${name}()`;\n const asFullyQualifiedName = `${asQualifiedName}()`;\n const asMethodWithArgs = generateMethodNamesWithArgs(\n name,\n idlAst.arguments\n );\n return {\n local: [asQualifiedName, asFullyQualifiedName, name],\n exportable: [asMethodName, ...asMethodWithArgs],\n };\n }\n case \"attribute\":\n return {\n local: [asQualifiedName],\n exportable: [name],\n };\n }\n}\n\n/**\n * Generates all possible permutations of a method name based\n * on what arguments they method accepts.\n\n * Required arguments are always present, and optional ones\n * are stacked one by one.\n *\n * For examples: foo(req1, req2), foo(req1, req2, opt1) and so on.\n *\n * @param {String} operationName\n * @param {*} argsAst\n */\nfunction generateMethodNamesWithArgs(operationName, argsAst) {\n const operationNames = [];\n if (argsAst.length === 0) {\n return operationNames;\n }\n const required = []; // required arguments\n const optional = []; // optional arguments, including variadic ones\n for (const { name, optional: isOptional, variadic } of argsAst) {\n if (isOptional || variadic) {\n optional.push(name);\n } else {\n required.push(name);\n }\n }\n const requiredArgs = required.join(\", \");\n const requiredOperation = `${operationName}(${requiredArgs})`;\n operationNames.push(requiredOperation);\n const optionalOps = optional.map((_, index) => {\n const args = [...required, ...optional.slice(0, index + 1)].join(\", \");\n const result = `${operationName}(${args})`;\n return result;\n });\n operationNames.push(...optionalOps);\n return operationNames;\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {string} name\n */\nfunction findOperationDfn(defn, parent, name) {\n // Overloads all have unique names\n if (name.includes(\"!overload\")) {\n return findNormalDfn(defn, parent, name);\n }\n const asMethodName = `${name}()`;\n return findNormalDfn(defn, parent, asMethodName, name);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {Record<\"local\" | \"exportable\", string[]>} names\n */\nfunction addAlternativeNames(dfn, names) {\n const { local, exportable } = names;\n const lt = dfn.dataset.lt ? new Set(dfn.dataset.lt.split(\"|\")) : new Set();\n for (const item of exportable) {\n lt.add(item);\n }\n // Fix any ill-placed ones - local ones don't belong here\n local.filter(item => lt.has(item)).forEach(item => lt.delete(item));\n dfn.dataset.lt = [...lt].join(\"|\");\n dfn.dataset.localLt = local.join(\"|\");\n registerDefinition(dfn, [...local, ...exportable]);\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {...string} names\n */\nfunction findNormalDfn(defn, parent, ...names) {\n const { type } = defn;\n for (const name of names) {\n let resolvedName =\n type === \"enum-value\" && name === \"\" ? \"the-empty-string\" : name;\n let dfns = getDfns(resolvedName, parent, name, type);\n // If we haven't found any definitions with explicit [for]\n // and [title], look for a dotted definition, \"parent.name\".\n if (dfns.length === 0 && parent !== \"\") {\n resolvedName = `${parent}.${resolvedName}`;\n const alternativeDfns = definitionMap.get(resolvedName);\n if (alternativeDfns && alternativeDfns.size === 1) {\n dfns = [...alternativeDfns];\n registerDefinition(dfns[0], [resolvedName]);\n }\n } else {\n resolvedName = name;\n }\n if (dfns.length > 1) {\n const msg = `WebIDL identifier \\`${name}\\` ${\n parent ? `for \\`${parent}\\`` : \"\"\n } is defined multiple times`;\n const title = \"Duplicate definition.\";\n showError(msg, name, { title, elements: dfns });\n }\n if (dfns.length) {\n return dfns[0];\n }\n }\n}\n\n/**\n * @param {HTMLElement} dfnElem\n * @param {*} idlAst\n * @param {string} parent\n * @param {string} name\n */\nexport function decorateDfn(dfnElem, idlAst, parent, name) {\n if (!dfnElem.id) {\n const lCaseParent = parent.toLowerCase();\n const middle = lCaseParent ? `${lCaseParent}-` : \"\";\n let last = name.toLowerCase().replace(/[()]/g, \"\").replace(/\\s/g, \"-\");\n if (last === \"\") {\n last = \"the-empty-string\";\n dfnElem.setAttribute(\"aria-label\", \"the empty string\");\n }\n dfnElem.id = `dom-${middle}${last}`;\n }\n dfnElem.dataset.idl = idlAst.type;\n dfnElem.dataset.title = dfnElem.textContent;\n dfnElem.dataset.dfnFor = parent;\n // Derive the data-type for dictionary members, interface attributes,\n // and methods\n switch (idlAst.type) {\n case \"operation\":\n case \"attribute\":\n case \"field\":\n dfnElem.dataset.type = getDataType(idlAst);\n break;\n }\n\n // Mark the definition as code.\n if (\n !dfnElem.querySelector(\"code\") &&\n !dfnElem.closest(\"code\") &&\n dfnElem.children\n ) {\n wrapInner(dfnElem, dfnElem.ownerDocument.createElement(\"code\"));\n }\n\n // Add data-lt and data-local-lt values and register them\n switch (idlAst.type) {\n case \"attribute\":\n case \"constructor\":\n case \"operation\":\n addAlternativeNames(dfnElem, getAlternativeNames(idlAst, parent, name));\n break;\n }\n\n return dfnElem;\n}\n\n/**\n * @param {string} name\n * @param {string} parent data-dfn-for\n * @param {string} originalName\n * @param {string} type\n */\nfunction getDfns(name, parent, originalName, type) {\n const foundDfns = definitionMap.get(name);\n if (!foundDfns || foundDfns.size === 0) {\n return [];\n }\n const dfnForArray = [...foundDfns];\n // Definitions that have a name and [data-dfn-for] that exactly match the\n // IDL entity:\n const dfns = dfnForArray.filter(dfn => {\n // This is explicitly marked as a concept, so we can't use it\n if (dfn.dataset.dfnType === \"dfn\") return false;\n\n /** @type {HTMLElement} */\n const closestDfnFor = dfn.closest(`[data-dfn-for]`);\n return closestDfnFor && closestDfnFor.dataset.dfnFor === parent;\n });\n\n if (dfns.length === 0 && parent === \"\" && dfnForArray.length === 1) {\n // Make sure the name exactly matches\n return dfnForArray[0].textContent === originalName ? dfnForArray : [];\n } else if (topLevelEntities.has(type) && dfnForArray.length) {\n const dfn = dfnForArray.find(\n dfn => dfn.textContent.trim() === originalName\n );\n if (dfn) return [dfn];\n }\n return dfns;\n}\n\n/**\n * @return {string}\n */\nfunction getDataType(idlStruct = {}) {\n const { idlType, generic, union } = idlStruct;\n if (idlType === undefined) return \"\";\n if (typeof idlType === \"string\") return idlType;\n if (generic) return generic;\n // join on \"|\" handles for \"unsigned short\" etc.\n if (union) return idlType.map(getDataType).join(\"|\");\n return getDataType(idlType);\n}\n","// @ts-check\n/**\n * Module core/webidl-clipboard\n *\n * This module adds a button to each IDL pre making it possible to copy\n * well-formatted IDL to the clipboard.\n *\n */\nexport const name = \"core/webidl-clipboard\";\n\nfunction createButton() {\n const copyButton = document.createElement(\"button\");\n copyButton.innerHTML =\n '<svg height=\"16\" viewBox=\"0 0 14 16\" width=\"14\"><path fill-rule=\"evenodd\" d=\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"/></svg>';\n copyButton.title = \"Copy IDL to clipboard\";\n copyButton.classList.add(\"respec-button-copy-paste\", \"removeOnSave\");\n return copyButton;\n}\n\nconst copyButton = createButton();\n\n/**\n * Adds a HTML button that copies WebIDL to the clipboard.\n *\n * @param {HTMLSpanElement} idlHeader\n */\nexport function addCopyIDLButton(idlHeader) {\n // There may be multiple <span>s of IDL, so we take everything\n // apart from the idl header.\n const pre = idlHeader.closest(\"pre.idl\");\n const idl = pre.cloneNode(true);\n idl.querySelector(\".idlHeader\").remove();\n const { textContent: idlText } = idl;\n const button = copyButton.cloneNode(true);\n button.addEventListener(\"click\", () => {\n navigator.clipboard.writeText(idlText);\n });\n idlHeader.append(button);\n}\n","/* --- WEB IDL --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\npre.idl {\n padding: 1em;\n position: relative;\n}\n\npre.idl > code {\n color: black;\n}\n\n@media print {\n pre.idl {\n white-space: pre-wrap;\n }\n}\n\n.idlHeader {\n display: block;\n width: 150px;\n background: #8ccbf2;\n color: #fff;\n font-family: sans-serif;\n font-weight: bold;\n margin: -1em 0 1em -1em;\n height: 28px;\n line-height: 28px;\n}\n\n.idlHeader a.self-link {\n margin-left: 0.3cm;\n text-decoration: none;\n border-bottom: none;\n}\n\n.idlID {\n font-weight: bold;\n color: #005a9c;\n}\n\n.idlType {\n color: #005a9c;\n}\n\n.idlName {\n color: #ff4500;\n}\n\n.idlName a {\n color: #ff4500;\n border-bottom: 1px dotted #ff4500;\n text-decoration: none;\n}\n\na.idlEnumItem {\n color: #000;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\n.idlSuperclass {\n font-style: italic;\n color: #005a9c;\n}\n\n/*.idlParam*/\n\n.idlParamName,\n.idlDefaultValue {\n font-style: italic;\n}\n\n.extAttr {\n color: #666;\n}\n\n/*.idlSectionComment*/\n\n.idlSectionComment {\n color: gray;\n}\n\n.idlIncludes a {\n font-weight: bold;\n}\n\n.respec-button-copy-paste:focus {\n text-decoration: none;\n border-color: #51a7e8;\n outline: none;\n box-shadow: 0 0 5px rgba(81, 167, 232, 0.5);\n}\n\n.respec-button-copy-paste:is(:focus:hover,.selected:focus) {\n border-color: #51a7e8;\n}\n\n.respec-button-copy-paste:is(:hover,:active,.zeroclipboard-is-hover,.zeroclipboard-is-active) {\n text-decoration: none;\n background-color: #ddd;\n background-image: linear-gradient(#eee, #ddd);\n border-color: #ccc;\n}\n\n.respec-button-copy-paste:is(:active,.selected,.zeroclipboard-is-active) {\n background-color: #dcdcdc;\n background-image: none;\n border-color: #b5b5b5;\n box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);\n}\n\n.respec-button-copy-paste.selected:hover {\n background-color: #cfcfcf;\n}\n\n.respec-button-copy-paste:is(:disabled,:disabled:hover,.disabled,.disabled:hover) {\n color: rgba(102, 102, 102, 0.5);\n cursor: default;\n background-color: rgba(229, 229, 229, 0.5);\n background-image: none;\n border-color: rgba(197, 197, 197, 0.5);\n box-shadow: none;\n}\n\n@media print {\n .respec-button-copy-paste {\n visibility: hidden;\n }\n}\n`;\n","// Module core/webidl\n// Highlights and links WebIDL marked up inside <pre class=\"idl\">.\n\n// TODO:\n// - It could be useful to report parsed IDL items as events\n// - don't use generated content in the CSS!\nimport {\n addHashId,\n docLink,\n showError,\n showWarning,\n wrapInner,\n xmlEscape,\n} from \"./utils.js\";\nimport { decorateDfn, findDfn } from \"./dfn-finder.js\";\nimport { html, webidl2 } from \"./import-maps.js\";\nimport { addCopyIDLButton } from \"./webidl-clipboard.js\";\nimport css from \"../styles/webidl.css.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/webidl\";\nconst pluginName = name;\n\nconst operationNames = {};\nconst idlPartials = {};\n\nconst templates = {\n wrap(items) {\n return items\n .flat()\n .filter(x => x !== \"\")\n .map(x => (typeof x === \"string\" ? new Text(x) : x));\n },\n trivia(t) {\n if (!t.trim()) {\n return t;\n }\n return html`<span class=\"idlSectionComment\">${t}</span>`;\n },\n generic(keyword) {\n // Shepherd classifies \"interfaces\" as starting with capital letters,\n // like Promise, FrozenArray, etc.\n return /^[A-Z]/.test(keyword)\n ? html`<a data-xref-type=\"interface\" data-cite=\"WEBIDL\">${keyword}</a>`\n : // Other keywords like sequence, maplike, etc...\n html`<a data-xref-type=\"dfn\" data-cite=\"WEBIDL\">${keyword}</a>`;\n },\n reference(wrapped, unescaped, context) {\n if (context.type === \"extended-attribute\") {\n return wrapped;\n }\n let type = \"_IDL_\";\n let cite = null;\n let lt;\n switch (unescaped) {\n case \"object\":\n type = \"interface\";\n cite = \"WEBIDL\";\n break;\n }\n return html`<a\n data-link-type=\"${type === \"_IDL_\" ? \"idl\" : type}\"\n data-xref-type=\"${type}\"\n data-cite=\"${cite}\"\n data-lt=\"${lt}\"\n >${wrapped}</a\n >`;\n },\n name(escaped, { data, parent }) {\n if (data.idlType && data.idlType.type === \"argument-type\") {\n return html`<span class=\"idlParamName\">${escaped}</span>`;\n }\n const idlLink = defineIdlName(escaped, data, parent);\n if (data.type !== \"enum-value\") {\n const className = parent ? \"idlName\" : \"idlID\";\n idlLink.classList.add(className);\n }\n return idlLink;\n },\n nameless(escaped, { data, parent }) {\n switch (data.type) {\n case \"operation\":\n case \"constructor\":\n return defineIdlName(escaped, data, parent);\n default:\n return escaped;\n }\n },\n type(contents) {\n return html`<span class=\"idlType\">${contents}</span>`;\n },\n inheritance(contents) {\n return html`<span class=\"idlSuperclass\">${contents}</span>`;\n },\n definition(contents, { data, parent }) {\n const className = getIdlDefinitionClassName(data);\n switch (data.type) {\n case \"includes\":\n case \"enum-value\":\n return html`<span class=\"${className}\">${contents}</span>`;\n }\n const parentName = parent ? parent.name : \"\";\n const { name, idlId } = getNameAndId(data, parentName);\n return html`<span\n class=\"${className}\"\n id=\"${idlId}\"\n data-idl\n data-title=\"${name}\"\n >${contents}</span\n >`;\n },\n extendedAttribute(contents) {\n const result = html`<span class=\"extAttr\">${contents}</span>`;\n return result;\n },\n extendedAttributeReference(name) {\n return html`<a data-xref-type=\"extended-attribute\">${name}</a>`;\n },\n};\n\n/**\n * Returns a link to existing <dfn> or creates one if doesn’t exists.\n */\nfunction defineIdlName(escaped, data, parent) {\n const parentName = parent ? parent.name : \"\";\n const { name } = getNameAndId(data, parentName);\n const dfn = findDfn(data, name, {\n parent: parentName,\n });\n const linkType = getDfnType(data.type);\n if (dfn) {\n if (!data.partial) {\n if (!dfn.matches(\"[data-noexport]\")) dfn.dataset.export = \"\";\n dfn.dataset.dfnType = linkType;\n }\n decorateDfn(dfn, data, parentName, name);\n const href = `#${dfn.id}`;\n return html`<a\n data-link-for=\"${parentName}\"\n data-link-type=\"${linkType}\"\n href=\"${href}\"\n class=\"internalDFN\"\n ><code>${escaped}</code></a\n >`;\n }\n\n const isDefaultJSON =\n data.type === \"operation\" &&\n data.name === \"toJSON\" &&\n data.extAttrs.some(({ name }) => name === \"Default\");\n if (isDefaultJSON) {\n return html`<a data-link-type=\"dfn\" data-lt=\"default toJSON steps\"\n >${escaped}</a\n >`;\n }\n if (!data.partial) {\n const dfn = html`<dfn data-export data-dfn-type=\"${linkType}\"\n >${escaped}</dfn\n >`;\n registerDefinition(dfn, [name]);\n decorateDfn(dfn, data, parentName, name);\n return dfn;\n }\n\n const unlinkedAnchor = html`<a\n data-idl=\"${data.partial ? \"partial\" : null}\"\n data-link-type=\"${linkType}\"\n data-title=\"${data.name}\"\n data-xref-type=\"${linkType}\"\n >${escaped}</a\n >`;\n\n const showWarnings =\n name && data.type !== \"typedef\" && !(data.partial && !dfn);\n if (showWarnings) {\n const styledName = data.type === \"operation\" ? `${name}()` : name;\n const ofParent = parentName ? ` \\`${parentName}\\`'s` : \"\";\n const msg = `Missing \\`<dfn>\\` for${ofParent} \\`${styledName}\\` ${data.type}.`;\n const hint = docLink`See ${\"using `data-dfn-for`|#data-dfn-for\"} in ReSpec's documentation.`;\n showWarning(msg, pluginName, { elements: [unlinkedAnchor], hint });\n }\n return unlinkedAnchor;\n}\n\n/**\n * Map to Shepherd types, for export.\n * @see https://tabatkins.github.io/bikeshed/#dfn-types\n */\nfunction getDfnType(idlType) {\n switch (idlType) {\n case \"operation\":\n return \"method\";\n case \"field\":\n return \"dict-member\";\n case \"callback interface\":\n case \"interface mixin\":\n return \"interface\";\n default:\n return idlType;\n }\n}\n\nfunction getIdlDefinitionClassName(defn) {\n switch (defn.type) {\n case \"callback interface\":\n return \"idlInterface\";\n case \"operation\":\n return \"idlMethod\";\n case \"field\":\n return \"idlMember\";\n case \"enum-value\":\n return \"idlEnumItem\";\n case \"callback function\":\n return \"idlCallback\";\n }\n return `idl${defn.type[0].toUpperCase()}${defn.type.slice(1)}`;\n}\n\nconst nameResolverMap = new WeakMap();\nfunction getNameAndId(defn, parent = \"\") {\n if (nameResolverMap.has(defn)) {\n return nameResolverMap.get(defn);\n }\n const result = resolveNameAndId(defn, parent);\n nameResolverMap.set(defn, result);\n return result;\n}\n\nfunction resolveNameAndId(defn, parent) {\n let name = getDefnName(defn);\n // For getters, setters, etc. \"anonymous-getter\",\n const prefix = defn.special && defn.name === \"\" ? \"anonymous-\" : \"\";\n let idlId = getIdlId(prefix + name, parent);\n switch (defn.type) {\n // Top-level entities with linkable members.\n case \"callback interface\":\n case \"dictionary\":\n case \"interface\":\n case \"interface mixin\": {\n idlId += resolvePartial(defn);\n break;\n }\n case \"constructor\":\n case \"operation\": {\n const overload = resolveOverload(name, parent);\n if (overload) {\n name += overload;\n idlId += overload;\n } else if (defn.arguments.length) {\n idlId += defn.arguments\n .map(arg => `-${arg.name.toLowerCase()}`)\n .join(\"\");\n }\n break;\n }\n }\n return { name, idlId };\n}\n\nfunction resolvePartial(defn) {\n if (!defn.partial) {\n return \"\";\n }\n if (!idlPartials[defn.name]) {\n idlPartials[defn.name] = 0;\n }\n idlPartials[defn.name] += 1;\n return `-partial-${idlPartials[defn.name]}`;\n}\n\nfunction resolveOverload(name, parentName) {\n const qualifiedName = `${parentName}.${name}`;\n const fullyQualifiedName = `${qualifiedName}()`;\n let overload;\n if (!operationNames[fullyQualifiedName]) {\n operationNames[fullyQualifiedName] = 0;\n }\n if (!operationNames[qualifiedName]) {\n operationNames[qualifiedName] = 0;\n } else {\n overload = `!overload-${operationNames[qualifiedName]}`;\n }\n operationNames[fullyQualifiedName] += 1;\n operationNames[qualifiedName] += 1;\n return overload || \"\";\n}\n\nfunction getIdlId(name, parentName) {\n if (!parentName) {\n return `idl-def-${name.toLowerCase()}`;\n }\n return `idl-def-${parentName.toLowerCase()}-${name.toLowerCase()}`;\n}\n\nfunction getDefnName(defn) {\n switch (defn.type) {\n case \"enum-value\":\n return defn.value;\n case \"operation\":\n return defn.name || defn.special;\n default:\n return defn.name || defn.type;\n }\n}\n\n// IDL types that never need a data-dfn-for\nconst topLevelIdlTypes = [\n \"interface\",\n \"interface mixin\",\n \"dictionary\",\n \"namespace\",\n \"enum\",\n \"typedef\",\n \"callback\",\n];\n\n/**\n * @param {Element} idlElement\n * @param {number} index\n */\nfunction renderWebIDL(idlElement, index) {\n let parse;\n try {\n parse = webidl2.parse(idlElement.textContent, {\n sourceName: String(index),\n });\n } catch (e) {\n const msg = `Failed to parse WebIDL: ${e.bareMessage}.`;\n showError(msg, pluginName, {\n title: e.bareMessage,\n details: `<pre>${e.context}</pre>`,\n elements: [idlElement],\n });\n // Skip this <pre> and move on to the next one.\n return [];\n }\n // we add \"idl\" as the canonical match, so both \"webidl\" and \"idl\" work\n idlElement.classList.add(\"def\", \"idl\");\n const highlights = webidl2.write(parse, { templates });\n html.bind(idlElement)`${highlights}`;\n wrapInner(idlElement, document.createElement(\"code\"));\n idlElement.querySelectorAll(\"[data-idl]\").forEach(elem => {\n if (elem.dataset.dfnFor) {\n return;\n }\n const title = elem.dataset.title;\n // Select the nearest ancestor element that can contain members.\n const idlType = elem.dataset.dfnType;\n\n const parent = elem.parentElement.closest(\"[data-idl][data-title]\");\n if (parent && !topLevelIdlTypes.includes(idlType)) {\n elem.dataset.dfnFor = parent.dataset.title;\n }\n if (elem.localName === \"dfn\") {\n registerDefinition(elem, [title]);\n }\n });\n // cross reference\n const closestCite = idlElement.closest(\"[data-cite], body\");\n const { dataset } = closestCite;\n if (!dataset.cite) dataset.cite = \"WEBIDL\";\n // includes webidl in some form\n if (!/\\bwebidl\\b/i.test(dataset.cite)) {\n const cites = dataset.cite.trim().split(/\\s+/);\n dataset.cite = [\"WEBIDL\", ...cites].join(\" \");\n }\n addIDLHeader(idlElement);\n return parse;\n}\n/**\n * Adds a \"WebIDL\" decorative header/permalink to a block of WebIDL.\n * @param {HTMLPreElement} pre\n */\nexport function addIDLHeader(pre) {\n addHashId(pre, \"webidl\");\n const header = html`<span class=\"idlHeader\"\n ><a class=\"self-link\" href=\"${`#${pre.id}`}\">WebIDL</a></span\n >`;\n pre.prepend(header);\n addCopyIDLButton(header);\n}\n\nexport async function run() {\n const idls = document.querySelectorAll(\"pre.idl, pre.webidl\");\n if (!idls.length) {\n return;\n }\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.querySelector(\"head link, head > *:last-child\").before(style);\n\n const astArray = [...idls].map(renderWebIDL);\n\n const validations = webidl2.validate(astArray);\n for (const validation of validations) {\n let details = `<pre>${xmlEscape(validation.context)}</pre>`;\n if (validation.autofix) {\n validation.autofix();\n const idlToFix = webidl2.write(astArray[validation.sourceName]);\n const escaped = xmlEscape(idlToFix);\n details += `Try fixing as:\n <pre>${escaped}</pre>`;\n }\n const msg = `WebIDL validation error: ${validation.bareMessage}`;\n showError(msg, pluginName, {\n details,\n elements: [idls[validation.sourceName]],\n title: validation.bareMessage,\n });\n }\n document.normalize();\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n return dfnsByType.get(linkType) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\nimport { API_URL } from \"./xref.js\";\nimport { idb } from \"./import-maps.js\";\n\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {import('core/xref').XrefDatabase} XrefDatabase\n */\n\nconst STORE_NAME = \"xrefs\";\nconst VERSION_CHECK_WAIT = 5 * 60 * 1000; // 5 min\n\nasync function getIdbCache() {\n /** @type {XrefDatabase} */\n const db = await idb.openDB(\"xref\", 2, {\n upgrade(db) {\n [...db.objectStoreNames].forEach(s => db.deleteObjectStore(s));\n const store = db.createObjectStore(STORE_NAME, { keyPath: \"query.id\" });\n store.createIndex(\"byTerm\", \"query.term\", { unique: false });\n },\n });\n return db;\n}\n\n/** @param {RequestEntry[]} queries */\nexport async function resolveXrefCache(queries) {\n /** @type {Map<string, SearchResultEntry[]>} */\n const cachedData = new Map();\n\n const bustCache = await shouldBustCache();\n if (bustCache) {\n await clearXrefData();\n return cachedData;\n }\n\n const requiredKeySet = new Set(queries.map(query => query.id));\n try {\n const cache = await getIdbCache();\n let cursor = await cache.transaction(STORE_NAME).store.openCursor();\n while (cursor) {\n if (requiredKeySet.has(cursor.key)) {\n cachedData.set(cursor.key, cursor.value.result);\n }\n cursor = await cursor.continue();\n }\n } catch (err) {\n console.error(err);\n }\n return cachedData;\n}\n\n/**\n * Get last updated timestamp from server and bust cache based on that. This\n * way, we prevent dirty/erroneous/stale data being kept on a client (which is\n * possible if we use a `MAX_AGE` based caching strategy).\n */\nasync function shouldBustCache() {\n const key = \"XREF:LAST_VERSION_CHECK\";\n const lastChecked = parseInt(localStorage.getItem(key), 10);\n const now = Date.now();\n\n if (!lastChecked) {\n localStorage.setItem(key, now.toString());\n return false;\n }\n if (now - lastChecked < VERSION_CHECK_WAIT) {\n // avoid checking network for any data update if old cache \"fresh\"\n return false;\n }\n\n const url = new URL(\"meta/version\", API_URL).href;\n const res = await fetch(url);\n if (!res.ok) return false;\n const lastUpdated = await res.text();\n localStorage.setItem(key, now.toString());\n return parseInt(lastUpdated, 10) > lastChecked;\n}\n\n/**\n * @param {RequestEntry[]} queries\n * @param {Map<string, SearchResultEntry[]>} results\n */\nexport async function cacheXrefData(queries, results) {\n try {\n const cache = await getIdbCache();\n const tx = cache.transaction(STORE_NAME, \"readwrite\");\n for (const query of queries) {\n const result = results.get(query.id);\n tx.objectStore(STORE_NAME).add({ query, result });\n }\n await tx.done;\n } catch (e) {\n console.error(e);\n }\n}\n\nexport async function clearXrefData() {\n try {\n await getIdbCache().then(db => db.clear(STORE_NAME));\n } catch (e) {\n console.error(e);\n }\n}\n","// @ts-check\n/**\n * @module core/xref\n *\n * Automatically adds external references.\n *\n * Searches for the terms which do not have a local definition at xref API and\n * for each query, adds `data-cite` attributes to respective elements.\n * `core/data-cite` later converts these data-cite attributes to actual links.\n * https://github.com/w3c/respec/issues/1662\n */\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {Map<string, { elems: HTMLElement[], results: SearchResultEntry[], query: RequestEntry }>} ErrorCollection\n * @typedef {{ ambiguous: ErrorCollection, notFound: ErrorCollection }} Errors\n */\nimport { cacheXrefData, resolveXrefCache } from \"./xref-db.js\";\nimport {\n createResourceHint,\n docLink,\n joinAnd,\n joinOr,\n nonNormativeSelector,\n norm as normalize,\n showError,\n} from \"./utils.js\";\nimport { possibleExternalLinks } from \"./link-to-dfn.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/xref\";\n\nconst profiles = {\n \"web-platform\": [\"HTML\", \"INFRA\", \"URL\", \"WEBIDL\", \"DOM\", \"FETCH\"],\n};\n\nexport const API_URL = \"https://respec.org/xref/\";\n\n/** @type {{ term: string; spec: string; element: HTMLElement }[]} */\nexport const informativeRefsInNormative = [];\n\nif (\n !document.querySelector(\"link[rel='preconnect'][href='https://respec.org']\")\n) {\n const link = createResourceHint({\n hint: \"preconnect\",\n href: \"https://respec.org\",\n });\n document.head.appendChild(link);\n}\n\n/**\n * @param {Object} conf respecConfig\n */\nexport async function run(conf) {\n if (!conf.xref) {\n return;\n }\n\n const xref = normalizeConfig(conf.xref);\n if (xref.specs) {\n const bodyCite = document.body.dataset.cite\n ? document.body.dataset.cite.split(/\\s+/)\n : [];\n document.body.dataset.cite = bodyCite.concat(xref.specs).join(\" \");\n }\n\n const elems = possibleExternalLinks.concat(findExplicitExternalLinks());\n if (!elems.length) return;\n\n /** @type {RequestEntry[]} */\n const queryKeys = [];\n for (const elem of elems) {\n const entry = getRequestEntry(elem);\n entry.id = await objectHash(entry);\n queryKeys.push(entry);\n }\n\n const data = await getData(queryKeys, xref.url);\n addDataCiteToTerms(elems, queryKeys, data, conf);\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Find additional references that need to be looked up externally.\n * Examples: a[data-cite=\"spec\"], dfn[data-cite=\"spec\"], dfn.externalDFN\n */\nfunction findExplicitExternalLinks() {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n \":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])\"\n );\n /** @type {NodeListOf<HTMLElement>} */\n const externalDFNs = document.querySelectorAll(\"dfn.externalDFN\");\n return [...links]\n .filter(el => {\n // ignore empties\n if (el.textContent.trim() === \"\") return false;\n /** @type {HTMLElement} */\n const closest = el.closest(\"[data-cite]\");\n return !closest || closest.dataset.cite !== \"\";\n })\n .concat(...externalDFNs);\n}\n\n/**\n * converts conf.xref to object with url and spec properties\n */\nfunction normalizeConfig(xref) {\n const defaults = {\n url: API_URL,\n specs: null,\n };\n\n const config = Object.assign({}, defaults);\n\n const type = Array.isArray(xref) ? \"array\" : typeof xref;\n switch (type) {\n case \"boolean\":\n // using defaults already, as above\n break;\n case \"string\":\n if (xref.toLowerCase() in profiles) {\n Object.assign(config, { specs: profiles[xref.toLowerCase()] });\n } else {\n invalidProfileError(xref);\n }\n break;\n case \"array\":\n Object.assign(config, { specs: xref });\n break;\n case \"object\":\n Object.assign(config, xref);\n if (xref.profile) {\n const profile = xref.profile.toLowerCase();\n if (profile in profiles) {\n const specs = (xref.specs ?? []).concat(profiles[profile]);\n Object.assign(config, { specs });\n } else {\n invalidProfileError(xref.profile);\n }\n }\n break;\n default: {\n const msg = `Invalid value for \\`xref\\` configuration option. Received: \"${xref}\".`;\n showError(msg, name);\n }\n }\n return config;\n\n function invalidProfileError(profile) {\n const supportedProfiles = joinOr(Object.keys(profiles), s => `\"${s}\"`);\n const msg =\n `Invalid profile \"${profile}\" in \\`respecConfig.xref\\`. ` +\n `Please use one of the supported profiles: ${supportedProfiles}.`;\n showError(msg, name);\n }\n}\n\n/**\n * get xref API request entry (term and context) for given xref element\n * @param {HTMLElement} elem\n */\nfunction getRequestEntry(elem) {\n const isIDL = \"xrefType\" in elem.dataset;\n\n let term = getTermFromElement(elem);\n if (!isIDL) term = term.toLowerCase();\n\n const specs = getSpecContext(elem);\n const types = getTypeContext(elem, isIDL);\n const forContext = getForContext(elem, isIDL);\n\n return {\n // Add an empty `id` to ensure the shape of object returned stays same when\n // actual `id` is added later (minor perf optimization, also makes\n // TypeScript happy).\n id: \"\",\n term,\n types,\n ...(specs.length && { specs }),\n ...(typeof forContext === \"string\" && { for: forContext }),\n };\n}\n\n/** @param {HTMLElement} elem */\nexport function getTermFromElement(elem) {\n const { lt: linkingText } = elem.dataset;\n let term = linkingText ? linkingText.split(\"|\", 1)[0] : elem.textContent;\n term = normalize(term);\n return term === \"the-empty-string\" ? \"\" : term;\n}\n\n/**\n * Get spec context as a fallback chain, where each level (sub-array) represents\n * decreasing priority.\n * @param {HTMLElement} elem\n */\nfunction getSpecContext(elem) {\n /** @type {string[][]} */\n const specs = [];\n\n /** @type {HTMLElement} */\n let dataciteElem = elem.closest(\"[data-cite]\");\n\n // Traverse up towards the root element, adding levels of lower priority specs\n while (dataciteElem) {\n const cite = dataciteElem.dataset.cite.toLowerCase().replace(/[!?]/g, \"\");\n const cites = cite.split(/\\s+/).filter(s => s);\n if (cites.length) {\n specs.push(cites);\n }\n if (dataciteElem === elem) break;\n dataciteElem = dataciteElem.parentElement.closest(\"[data-cite]\");\n }\n\n // If element itself contains data-cite, we don't take inline context into\n // account. The inline bibref context has lowest priority, if available.\n if (dataciteElem !== elem) {\n const closestSection = elem.closest(\"section\");\n /** @type {Iterable<HTMLElement>} */\n const bibrefs = closestSection\n ? closestSection.querySelectorAll(\"a.bibref\")\n : [];\n const inlineRefs = [...bibrefs].map(el => el.textContent.toLowerCase());\n if (inlineRefs.length) {\n specs.push(inlineRefs);\n }\n }\n\n const uniqueSpecContext = dedupeSpecContext(specs);\n return uniqueSpecContext;\n}\n\n/**\n * If we already have a spec in a higher priority level (closer to element) of\n * fallback chain, skip it from low priority levels, to prevent duplication.\n * @param {string[][]} specs\n * */\nfunction dedupeSpecContext(specs) {\n /** @type {string[][]} */\n const unique = [];\n for (const level of specs) {\n const higherPriority = unique[unique.length - 1] || [];\n const uniqueSpecs = [...new Set(level)].filter(\n spec => !higherPriority.includes(spec)\n );\n unique.push(uniqueSpecs.sort());\n }\n return unique;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getForContext(elem, isIDL) {\n if (elem.dataset.xrefFor) {\n return normalize(elem.dataset.xrefFor);\n }\n\n if (isIDL) {\n /** @type {HTMLElement} */\n const dataXrefForElem = elem.closest(\"[data-xref-for]\");\n if (dataXrefForElem) {\n return normalize(dataXrefForElem.dataset.xrefFor);\n }\n }\n\n return null;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getTypeContext(elem, isIDL) {\n if (isIDL) {\n if (elem.dataset.xrefType) {\n return elem.dataset.xrefType.split(\"|\");\n }\n return [\"_IDL_\"];\n }\n\n return [\"_CONCEPT_\"];\n}\n\n/**\n * @param {RequestEntry[]} queryKeys\n * @param {string} apiUrl\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function getData(queryKeys, apiUrl) {\n const uniqueIds = new Set();\n const uniqueQueryKeys = queryKeys.filter(key => {\n return uniqueIds.has(key.id) ? false : uniqueIds.add(key.id) && true;\n });\n\n const resultsFromCache = await resolveXrefCache(uniqueQueryKeys);\n\n const termsToLook = uniqueQueryKeys.filter(\n key => !resultsFromCache.get(key.id)\n );\n const fetchedResults = await fetchFromNetwork(termsToLook, apiUrl);\n if (fetchedResults.size) {\n // add data to cache\n await cacheXrefData(uniqueQueryKeys, fetchedResults);\n }\n\n return new Map([...resultsFromCache, ...fetchedResults]);\n}\n\n/**\n * @param {RequestEntry[]} keys\n * @param {string} url\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function fetchFromNetwork(keys, url) {\n if (!keys.length) return new Map();\n\n const query = { keys };\n const options = {\n method: \"POST\",\n body: JSON.stringify(query),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n const response = await fetch(url, options);\n const json = await response.json();\n return new Map(json.result);\n}\n\n/**\n * Figures out from the tree structure if the reference is\n * normative (true) or informative (false).\n * @param {HTMLElement} elem\n */\nfunction isNormative(elem) {\n const closestNormative = elem.closest(\".normative\");\n const closestInform = elem.closest(nonNormativeSelector);\n if (!closestInform || elem === closestNormative) {\n return true;\n }\n return (\n closestNormative &&\n closestInform &&\n closestInform.contains(closestNormative)\n );\n}\n\n/**\n * adds data-cite attributes to elems for each term for which results are found.\n * adds citations to references section.\n * collects and shows linking errors if any.\n * @param {HTMLElement[]} elems\n * @param {RequestEntry[]} queryKeys\n * @param {Map<string, SearchResultEntry[]>} data\n * @param {any} conf\n */\nfunction addDataCiteToTerms(elems, queryKeys, data, conf) {\n /** @type {Errors} */\n const errors = { ambiguous: new Map(), notFound: new Map() };\n\n for (let i = 0, l = elems.length; i < l; i++) {\n if (elems[i].closest(\"[data-no-xref]\")) continue;\n\n const elem = elems[i];\n const query = queryKeys[i];\n\n const { id } = query;\n const results = data.get(id);\n if (results.length === 1) {\n addDataCite(elem, query, results[0], conf);\n } else {\n const collector = errors[results.length === 0 ? \"notFound\" : \"ambiguous\"];\n if (!collector.has(id)) {\n collector.set(id, { elems: [], results, query });\n }\n collector.get(id).elems.push(elem);\n }\n }\n\n showErrors(errors);\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {RequestEntry} query\n * @param {SearchResultEntry} result\n * @param {any} conf\n */\nfunction addDataCite(elem, query, result, conf) {\n const { term, specs = [] } = query;\n const { uri, shortname, spec, normative, type, for: forContext } = result;\n // if authored spec context had `result.spec`, use it instead of shortname\n const cite = specs.flat().includes(spec) ? spec : shortname;\n // we use this \"partial\" URL to resolve parts of urls...\n // but sometimes we get lucky and we get an absolute URL from xref\n // which we can then use in other places (e.g., data-cite.js)\n const url = new URL(uri, \"https://partial\");\n const { pathname: citePath } = url;\n const citeFrag = url.hash.slice(1);\n const dataset = { cite, citePath, citeFrag, type };\n if (forContext) dataset.linkFor = forContext[0];\n if (url.origin && url.origin !== \"https://partial\") {\n dataset.citeHref = url.href;\n }\n Object.assign(elem.dataset, dataset);\n\n addToReferences(elem, cite, normative, term, conf);\n}\n\n/**\n * add specs for citation (references section)\n * @param {HTMLElement} elem\n * @param {string} cite\n * @param {boolean} normative\n * @param {string} term\n * @param {any} conf\n */\nfunction addToReferences(elem, cite, normative, term, conf) {\n const isNormRef = isNormative(elem);\n if (!isNormRef) {\n // Only add it if not already normative...\n if (!conf.normativeReferences.has(cite)) {\n conf.informativeReferences.add(cite);\n }\n return;\n }\n if (normative) {\n // If it was originally informative, we move the existing\n // key to be normative.\n const existingKey = conf.informativeReferences.has(cite)\n ? conf.informativeReferences.getCanonicalKey(cite)\n : cite;\n conf.normativeReferences.add(existingKey);\n conf.informativeReferences.delete(existingKey);\n return;\n }\n\n // This is used by the informative-dfn linter\n informativeRefsInNormative.push({ term, spec: cite, element: elem });\n}\n\n/** @param {Errors} errors */\nfunction showErrors({ ambiguous, notFound }) {\n const getPrefilledFormURL = (term, query, specs = []) => {\n const url = new URL(API_URL);\n url.searchParams.set(\"term\", term);\n if (query.for) url.searchParams.set(\"for\", query.for);\n url.searchParams.set(\"types\", query.types.join(\",\"));\n if (specs.length) url.searchParams.set(\"specs\", specs.join(\",\"));\n return url.href;\n };\n\n const howToFix = (howToCiteURL, originalTerm) => {\n return docLink`[See search matches for \"${originalTerm}\"](${howToCiteURL}) or ${\"[Learn about this error|#error-term-not-found]\"}.`;\n };\n\n for (const { query, elems } of notFound.values()) {\n const specs = query.specs ? [...new Set(query.specs.flat())].sort() : [];\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query);\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const hint = howToFix(formUrl, originalTerm);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const msg = `Couldn't find \"**${originalTerm}**\"${forParent} in this document or other cited documents: ${specsString}.`;\n const title = \"No matching definition found.\";\n showError(msg, name, { title, elements: elems, hint });\n }\n\n for (const { query, elems, results } of ambiguous.values()) {\n const specs = [...new Set(results.map(entry => entry.shortname))].sort();\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const moreInfo = howToFix(formUrl, originalTerm);\n const hint = docLink`To fix, use the ${\"[data-cite]\"} attribute to pick the one you mean from the appropriate specification. ${moreInfo}.`;\n const msg = `The term \"**${originalTerm}**\"${forParent} is ambiguous because it's defined in ${specsString}.`;\n const title = \"Definition is ambiguous.\";\n showError(msg, name, { title, elements: elems, hint });\n }\n}\n\nfunction objectHash(obj) {\n const str = JSON.stringify(obj, Object.keys(obj).sort());\n const buffer = new TextEncoder().encode(str);\n return crypto.subtle.digest(\"SHA-1\", buffer).then(bufferToHexString);\n}\n\n/** @param {ArrayBuffer} buffer */\nfunction bufferToHexString(buffer) {\n const byteArray = new Uint8Array(buffer);\n return [...byteArray].map(v => v.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction cleanup(doc) {\n const elems = doc.querySelectorAll(\n \"a[data-xref-for], a[data-xref-type], a[data-link-for]\"\n );\n const attrToRemove = [\"data-xref-for\", \"data-xref-type\", \"data-link-for\"];\n elems.forEach(el => {\n attrToRemove.forEach(attr => el.removeAttribute(attr));\n });\n}\n","/*\n@module \"core/dfn-index\"\nExtends and overrides some styles from `base.css`.\n*/\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nul.index {\n columns: 30ch;\n column-gap: 1.5em;\n}\n\nul.index li {\n list-style: inherit;\n}\n\nul.index li span {\n color: inherit;\n cursor: pointer;\n white-space: normal;\n}\n\n#index-defined-here ul.index li {\n font-size: 0.9rem;\n}\n\nul.index code {\n color: inherit;\n}\n\n#index-defined-here .print-only {\n display: none;\n}\n\n@media print {\n #index-defined-here .print-only {\n display: initial;\n }\n}\n`;\n","// @ts-check\n/**\n * If a `<section id=\"index\">` exists, it is filled by a list of terms defined\n * (locally) by current document and a list of terms referenced (external) by\n * current document.\n */\n\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport css from \"../styles/dfn-index.css.js\";\nimport { getTermFromElement } from \"./xref.js\";\nimport { html } from \"./import-maps.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\nimport { sub } from \"./pubsubhub.js\";\nimport { toCiteDetails } from \"./data-cite.js\";\n\nexport const name = \"core/dfn-index\";\n\nconst localizationStrings = {\n en: {\n heading: \"Index\",\n headingExternal: \"Terms defined by reference\",\n headlingLocal: \"Terms defined by this specification\",\n dfnOf: \"definition of\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Terms of these _types_ are wrapped in `<code>`.\nconst CODE_TYPES = new Set([\n \"attribute\",\n \"callback\",\n \"dict-member\",\n \"dictionary\",\n \"element-attr\",\n \"element\",\n \"enum-value\",\n \"enum\",\n \"exception\",\n \"extended-attribute\",\n \"interface\",\n \"method\",\n \"typedef\",\n]);\n\n/**\n * @typedef {{ term: string, type: string, linkFor: string, elem: HTMLAnchorElement }} Entry\n */\n\nexport function run() {\n const index = document.querySelector(\"section#index\");\n if (!index) {\n // See below...\n sub(\"toc\", () => {}, { once: true });\n return;\n }\n\n const styleEl = document.createElement(\"style\");\n styleEl.textContent = css;\n document.head.appendChild(styleEl);\n\n index.classList.add(\"appendix\");\n if (!index.querySelector(\"h2, h1\")) {\n index.prepend(html`<h1>${l10n.heading}</h1>`);\n }\n\n const localTermIndex = html`<section id=\"index-defined-here\">\n <h3>${l10n.headlingLocal}</h3>\n ${createLocalTermIndex()}\n </section>`;\n index.append(localTermIndex);\n\n const externalTermIndex = html`<section id=\"index-defined-elsewhere\">\n <h3>${l10n.headingExternal}</h3>\n ${createExternalTermIndex()}\n </section>`;\n index.append(externalTermIndex);\n for (const el of externalTermIndex.querySelectorAll(\".index-term\")) {\n addId(el, \"index-term\");\n }\n\n // XXX: This event is used to overcome an edge case with core/structure,\n // related to a circular dependency in plugin run order. We want\n // core/structure to run after dfn-index so the #index can be listed in the\n // TOC, but we also want section numbers in dfn-index. So, we \"split\"\n // core/dfn-index in two parts, one that runs before core/structure (using\n // plugin order in profile) and the other (following) after section numbers\n // are generated in core/structure (this event).\n sub(\"toc\", appendSectionNumbers, { once: true });\n\n sub(\"beforesave\", cleanup);\n}\n\nfunction createLocalTermIndex() {\n const dataSortedByTerm = collectLocalTerms();\n return html`<ul class=\"index\">\n ${dataSortedByTerm.map(([term, dfns]) => renderLocalTerm(term, dfns))}\n </ul>`;\n}\n\nfunction collectLocalTerms() {\n /** @type {Map<string, HTMLElement[]>} */\n const data = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"dfn:not([data-cite])\");\n for (const elem of elems) {\n if (!elem.id) continue;\n const text = norm(elem.textContent);\n const elemsByTerm = data.get(text) || data.set(text, []).get(text);\n elemsByTerm.push(elem);\n }\n\n const dataSortedByTerm = [...data].sort(([a], [b]) =>\n a.slice(a.search(/\\w/)).localeCompare(b.slice(b.search(/\\w/)))\n );\n\n return dataSortedByTerm;\n}\n\n/**\n * @param {string} term\n * @param {HTMLElement[]} dfns\n * @returns {HTMLLIElement}\n */\nfunction renderLocalTerm(term, dfns) {\n const renderItem = (dfn, text, suffix) => {\n const href = `#${dfn.id}`;\n return html`<li data-id=${dfn.id}>\n <a class=\"index-term\" href=\"${href}\">${{ html: text }}</a> ${suffix\n ? { html: suffix }\n : \"\"}\n </li>`;\n };\n\n if (dfns.length === 1) {\n const dfn = dfns[0];\n const type = getLocalTermType(dfn);\n const text = getLocalTermText(dfn, type, term);\n const suffix = getLocalTermSuffix(dfn, type, term);\n return renderItem(dfn, text, suffix);\n }\n return html`<li>\n ${term}\n <ul>\n ${dfns.map(dfn => {\n const type = getLocalTermType(dfn);\n const text = getLocalTermSuffix(dfn, type, term) || l10n.dfnOf;\n return renderItem(dfn, text);\n })}\n </ul>\n </li>`;\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermType(dfn) {\n const ds = dfn.dataset;\n const type = ds.dfnType || ds.idl || ds.linkType || \"\";\n switch (type) {\n case \"\":\n case \"dfn\":\n return \"\";\n default:\n return type;\n }\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermParentContext(dfn) {\n /** @type {HTMLElement} */\n const dfnFor = dfn.closest(\"[data-dfn-for]:not([data-dfn-for=''])\");\n return dfnFor ? dfnFor.dataset.dfnFor : \"\";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} term\n */\nfunction getLocalTermText(dfn, type, term) {\n let text = term;\n if (type === \"enum-value\") {\n text = `\"${text}\"`;\n }\n if (CODE_TYPES.has(type) || dfn.dataset.idl || dfn.closest(\"code\")) {\n text = `<code>${text}</code>`;\n }\n return text;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} [term=\"\"]\n */\nfunction getLocalTermSuffix(dfn, type, term = \"\") {\n if (term.startsWith(\"[[\")) {\n const parent = getLocalTermParentContext(dfn);\n return `internal slot for <code>${parent}</code>`;\n }\n\n switch (type) {\n case \"dict-member\":\n case \"method\":\n case \"attribute\":\n case \"enum-value\": {\n const typeText =\n type === \"dict-member\" ? \"member\" : type.replace(\"-\", \" \");\n const parent = getLocalTermParentContext(dfn);\n return `${typeText} for <code>${parent}</code>`;\n }\n case \"interface\":\n case \"dictionary\":\n case \"enum\": {\n return type;\n }\n case \"constructor\": {\n const parent = getLocalTermParentContext(dfn);\n return `for <code>${parent}</code>`;\n }\n default:\n return \"\";\n }\n}\n\nfunction appendSectionNumbers() {\n const getSectionNumber = id => {\n const dfn = document.getElementById(id);\n const sectionNumberEl = dfn.closest(\"section\").querySelector(\".secno\");\n const secNum = `§${sectionNumberEl.textContent.trim()}`;\n return html`<span class=\"print-only\">${secNum}</span>`;\n };\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"#index-defined-here li[data-id]\");\n elems.forEach(el => el.append(getSectionNumber(el.dataset.id)));\n}\n\nfunction createExternalTermIndex() {\n const data = collectExternalTerms();\n const dataSortedBySpec = [...data.entries()].sort(([specA], [specB]) =>\n specA.localeCompare(specB)\n );\n return html`<ul class=\"index\">\n ${dataSortedBySpec.map(\n ([spec, entries]) => html`<li data-spec=\"${spec}\">\n ${renderInlineCitation(spec)} defines the following:\n <ul>\n ${entries\n .sort((a, b) => a.term.localeCompare(b.term))\n .map(renderExternalTermEntry)}\n </ul>\n </li>`\n )}\n </ul>`;\n}\n\nfunction collectExternalTerms() {\n /** @type {Set<string>} */\n const uniqueReferences = new Set();\n /** @type {Map<string, Entry[]>} spec => entry[] */\n const data = new Map();\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elements = document.querySelectorAll(`a[data-cite]`);\n for (const elem of elements) {\n if (!elem.dataset.cite) {\n continue;\n }\n const uniqueID = elem.href;\n if (uniqueReferences.has(uniqueID)) {\n continue;\n }\n\n const { type, linkFor } = elem.dataset;\n const term = getTermFromElement(elem);\n if (!term) {\n continue; // <a data-cite=\"SPEC\"></a>\n }\n const spec = toCiteDetails(elem).key.toUpperCase();\n\n const entriesBySpec = data.get(spec) || data.set(spec, []).get(spec);\n entriesBySpec.push({ term, type, linkFor, elem });\n uniqueReferences.add(uniqueID);\n }\n\n return data;\n}\n\n/**\n * @param {Entry} entry\n * @returns {HTMLLIElement}\n */\nfunction renderExternalTermEntry(entry) {\n const { elem } = entry;\n const text = getTermText(entry);\n const el = html`<li>\n <span class=\"index-term\" data-href=\"${elem.href}\">${{ html: text }}</span>\n </li>`;\n return el;\n}\n\n// Terms of these _types_ are suffixed with their type info.\nconst TYPED_TYPES = new Map([\n [\"attribute\", \"attribute\"],\n [\"element-attr\", \"attribute\"],\n [\"element\", \"element\"],\n [\"enum\", \"enum\"],\n [\"exception\", \"exception\"],\n [\"extended-attribute\", \"extended attribute\"],\n [\"interface\", \"interface\"],\n]);\n\n// These _terms_ have type suffix \"type\".\nconst TYPE_TERMS = new Set([\n // Following are primitive types as per WebIDL spec:\n \"boolean\",\n \"byte\",\n \"octet\",\n \"short\",\n \"unsigned short\",\n \"long\",\n \"unsigned long\",\n \"long long\",\n \"unsigned long long\",\n \"float\",\n \"unrestricted float\",\n \"double\",\n \"unrestricted double\",\n // Following are not primitive types, but aren't interfaces either.\n \"undefined\",\n \"any\",\n \"object\",\n \"symbol\",\n]);\n\n/** @param {Entry} entry */\nfunction getTermText(entry) {\n const { term, type, linkFor } = entry;\n let text = term;\n\n if (CODE_TYPES.has(type)) {\n if (type === \"extended-attribute\") {\n text = `[${text}]`;\n }\n text = `<code>${text}</code>`;\n }\n\n const typeSuffix = TYPE_TERMS.has(term) ? \"type\" : TYPED_TYPES.get(type);\n if (typeSuffix) {\n text += ` ${typeSuffix}`;\n }\n\n if (linkFor) {\n let linkForText = linkFor;\n if (!/\\s/.test(linkFor)) {\n // If linkFor is a single word, highlight it.\n linkForText = `<code>${linkForText}</code>`;\n }\n if (type === \"element-attr\") {\n linkForText += \" element\";\n }\n text += ` (for ${linkForText})`;\n }\n\n return text;\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n doc\n .querySelectorAll(\"#index-defined-elsewhere li[data-spec]\")\n .forEach(el => el.removeAttribute(\"data-spec\"));\n\n doc\n .querySelectorAll(\"#index-defined-here li[data-id]\")\n .forEach(el => el.removeAttribute(\"data-id\"));\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n/**\n * Module: core/webidl-index\n * constructs a summary of WebIDL in the document by\n * cloning all the generated WebIDL nodes and\n * appending them to pre element.\n *\n * Usage\n * Add a <section id=\"idl-index\"> to the document.\n * It also supports title elements to generate a header.\n * Or if a header element is an immediate child, then\n * that is preferred.\n */\nexport const name = \"core/webidl-index\";\nimport { nonNormativeSelector, wrapInner } from \"./utils.js\";\nimport { addIDLHeader } from \"./webidl.js\";\n\nexport function run() {\n /** @type {HTMLElement | null} */\n const idlIndexSec = document.querySelector(\"section#idl-index\");\n if (!idlIndexSec) {\n return;\n }\n // Query for decedents headings, e.g., \"h2:first-child, etc..\"\n const query = [2, 3, 4, 5, 6].map(level => `h${level}:first-child`).join(\",\");\n if (!idlIndexSec.querySelector(query)) {\n const header = document.createElement(\"h2\");\n if (idlIndexSec.title) {\n header.textContent = idlIndexSec.title;\n idlIndexSec.removeAttribute(\"title\");\n } else {\n header.textContent = \"IDL Index\";\n }\n idlIndexSec.prepend(header);\n }\n\n // filter out the IDL marked with class=\"exclude\" and the IDL in non-normative sections\n const idlIndex = Array.from(\n document.querySelectorAll(\"pre.idl:not(.exclude) > code\")\n ).filter(idl => !idl.closest(nonNormativeSelector));\n\n if (idlIndex.length === 0) {\n const text = \"This specification doesn't normatively declare any Web IDL.\";\n idlIndexSec.append(text);\n return;\n }\n\n const pre = document.createElement(\"pre\");\n pre.classList.add(\"idl\", \"def\");\n pre.id = \"actual-idl-index\";\n idlIndex\n .map(elem => {\n const fragment = document.createDocumentFragment();\n for (const child of elem.children) {\n fragment.appendChild(child.cloneNode(true));\n }\n return fragment;\n })\n .forEach(elem => {\n if (pre.lastChild) {\n pre.append(\"\\n\\n\");\n }\n pre.appendChild(elem);\n });\n // Remove duplicate IDs\n pre.querySelectorAll(\"*[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n\n // Add our own IDL header\n idlIndexSec.appendChild(pre);\n wrapInner(pre, document.createElement(\"code\"));\n addIDLHeader(pre);\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","/* container for stats */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n\n.caniuse-stats {\n display: flex;\n column-gap: 2em;\n}\n\n.caniuse-group {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: flex-end;\n flex-basis: auto;\n}\n\n.caniuse-browsers {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-top: .2em;\n column-gap: .4em;\n border-bottom: 1px solid #ccc;\n row-gap: .4em;\n padding-bottom: .4cm;\n}\n\n.caniuse-type {\n align-self: center;\n border-top: none;\n text-transform: capitalize;\n font-size: .8em;\n margin-top: -.8em;\n font-weight: bold;\n}\n\n.caniuse-type span {\n background-color: white;\n padding: 0 0.4em;\n}\n\n/* a browser version */\n.caniuse-cell {\n align-items: center;\n border-radius: 1cm;\n color: #fff;\n display: flex;\n font-size: 90%;\n min-width: 1.5cm;\n padding: .3rem;\n justify-content: space-evenly;\n --supported: #2a8436dd;\n --no-support: #c44230dd;\n --no-support-alt: #b43b2bdd;\n --partial: #807301dd;\n --partial-alt: #746c00dd;\n --unknown: #757575;\n\n background: repeating-linear-gradient(\n var(--caniuse-angle, 45deg),\n var(--caniuse-bg) 0,\n var(--caniuse-bg-alt) 1px,\n var(--caniuse-bg-alt) 0.4em,\n var(--caniuse-bg) calc(0.25em + 1px),\n var(--caniuse-bg) 0.75em\n );\n}\n\nimg.caniuse-browser {\n filter: drop-shadow(0px 0px .1cm #666666);\n}\n\n.caniuse-cell span.browser-version {\n margin-left: 0.4em;\n text-shadow: 0 0 0.1em #fff;\n font-weight: 100;\n font-size: .9em;\n}\n\n.caniuse-stats a[href] {\n white-space: nowrap;\n align-self: flex-end;\n}\n\n/* supports */\n.caniuse-cell.y {\n background: var(--supported);\n}\n\n/* no support, disabled by default */\n.caniuse-cell:is(.n,.d) {\n --caniuse-angle: 45deg;\n --caniuse-bg: var(--no-support);\n --caniuse-bg-alt: var(--no-support-alt);\n}\n\n.caniuse-cell.u {\n background: var(--unknown);\n}\n\n.caniuse-cell.d {\n --caniuse-angle: 180deg;\n}\n\n/* not supported by default / partial support etc\nsee https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md for stats */\n.caniuse-cell:is(.a,.x,.p) {\n --caniuse-angle: 90deg;\n --caniuse-bg: var(--partial);\n --caniuse-bg-alt: var(--partial-alt);\n}\n\n/* handle case when printing */\n@media print {\n .caniuse-cell.y::before {\n content: \"✔️\";\n padding: 0.5em;\n }\n\n .caniuse-cell.n::before {\n content: \"❌\";\n padding: 0.5em;\n }\n\n .caniuse-cell:is(.a,.d,.p,.x,.u)::before {\n content: \"⚠️\";\n padding: 0.5em;\n }\n}\n`;\n","// @ts-check\n/**\n * Module: \"core/caniuse\"\n * Adds a caniuse support table for a \"feature\" #1238\n * Usage options: https://github.com/w3c/respec/wiki/caniuse\n */\nimport { codedJoinAnd, docLink, showError, showWarning } from \"./utils.js\";\nimport { pub, sub } from \"./pubsubhub.js\";\nimport css from \"../styles/caniuse.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/caniuse\";\n\nconst API_URL = \"https://respec.org/caniuse/\";\n\nexport const BROWSERS = new Map([\n [\"and_chr\", { name: \"Android Chrome\", path: \"chrome\", type: \"mobile\" }],\n [\"and_ff\", { name: \"Android Firefox\", path: \"firefox\", type: \"mobile\" }],\n [\"and_uc\", { name: \"Android UC\", path: \"uc\", type: \"mobile\" }],\n [\"chrome\", { name: \"Chrome\", type: \"desktop\" }],\n [\"edge\", { name: \"Edge\", type: \"desktop\" }],\n [\"firefox\", { name: \"Firefox\", type: \"desktop\" }],\n [\"ios_saf\", { name: \"iOS Safari\", path: \"safari-ios\", type: \"mobile\" }],\n [\"op_mob\", { name: \"Opera Mobile\", path: \"opera\", type: \"mobile\" }],\n [\"opera\", { name: \"Opera\", type: \"desktop\" }],\n [\"safari\", { name: \"Safari\", type: \"desktop\" }],\n [\n \"samsung\",\n { name: \"Samsung Internet\", path: \"samsung-internet\", type: \"mobile\" },\n ],\n]);\n\nconst statToText = new Map([\n [\"a\", \"almost supported (aka Partial support)\"],\n [\"d\", \"disabled by default\"],\n [\"n\", \"no support, or disabled by default\"],\n [\"p\", \"no support, but has Polyfill\"],\n [\"u\", \"unknown support\"],\n [\"x\", \"requires prefix to work\"],\n [\"y\", \"supported by default\"],\n]);\n\nexport function prepare(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n normalizeCaniuseConf(conf);\n validateBrowsers(conf);\n const options = conf.caniuse;\n if (!options.feature) {\n return; // no feature to show\n }\n\n document.head.appendChild(html`<style\n id=\"caniuse-stylesheet\"\n class=\"${options.removeOnSave ? \"removeOnSave\" : \"\"}\"\n >\n ${css}\n </style>`);\n}\n/**\n * @param {string} browser\n * @returns\n */\nfunction getLogoSrc(browser) {\n const path = BROWSERS.get(browser).path ?? browser;\n return `https://cdn.w3.org/assets/logos/browser-logos/${path}/${path}.svg`;\n}\n\nexport async function run(conf) {\n const options = conf.caniuse;\n if (!options?.feature) return;\n\n const featureURL = new URL(options.feature, \"https://caniuse.com/\").href;\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = fetchStats(conf.caniuse)\n .then(json => processJson(json, options))\n .catch(err => handleError(err, options, featureURL));\n const definitionPair = html`<dt class=\"caniuse-title\">Browser support:</dt>\n <dd class=\"caniuse-stats\">\n ${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}\n </dd>`;\n headDlElem.append(...definitionPair.childNodes);\n await contentPromise;\n pub(\"amend-user-config\", { caniuse: options.feature });\n if (options.removeOnSave) {\n // Will remove the browser support cells.\n headDlElem\n .querySelectorAll(\".caniuse-browser\")\n .forEach(elem => elem.classList.add(\"removeOnSave\"));\n sub(\"beforesave\", outputDoc => {\n html.bind(outputDoc.querySelector(\".caniuse-stats\"))`\n <a href=\"${featureURL}\">caniuse.com</a>`;\n });\n }\n}\n\nfunction handleError(err, options, featureURL) {\n const msg = `Failed to retrieve feature \"${options.feature}\".`;\n const hint = docLink`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${\"[caniuse]\"}.`;\n showError(msg, name, { hint });\n console.error(err);\n return html`<a href=\"${featureURL}\">caniuse.com</a>`;\n}\n\n/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction normalizeCaniuseConf(conf) {\n const defaultBrowsers = new Set(BROWSERS.keys());\n defaultBrowsers.delete(\"op_mob\");\n defaultBrowsers.delete(\"opera\");\n const DEFAULTS = { removeOnSave: true, browsers: [...defaultBrowsers] };\n if (typeof conf.caniuse === \"string\") {\n conf.caniuse = { feature: conf.caniuse, ...DEFAULTS };\n return;\n }\n conf.caniuse = { ...DEFAULTS, ...conf.caniuse };\n}\n\nfunction validateBrowsers({ caniuse }) {\n const { browsers } = caniuse;\n const invalidBrowsers = browsers.filter(browser => !BROWSERS.has(browser));\n if (invalidBrowsers.length) {\n const names = codedJoinAnd(invalidBrowsers, { quotes: true });\n const msg = docLink`Invalid browser(s): (${names}) in the \\`browser\\` property of ${\"[caniuse]\"}.`;\n showWarning(msg, name);\n }\n}\n\nasync function processJson(json, { feature }) {\n /** @type {Array} */\n const results = json.result;\n const groups = new Map([\n [\"desktop\", []],\n [\"mobile\", []],\n ]);\n const toBrowserCell = browserCellRenderer(feature);\n results.reduce(toBrowserCell, groups);\n const out = [...groups]\n .filter(([, arr]) => arr.length)\n .map(\n ([key, arr]) =>\n html`<div class=\"caniuse-group\">\n <div class=\"caniuse-browsers\">${arr}</div>\n <div class=\"caniuse-type\"><span>${key}</div>\n </div>`\n );\n out.push(\n html`<a class=\"caniuse-cell\" href=\"https://caniuse.com/${feature}\"\n >More info</a\n >`\n );\n return out;\n}\n\nfunction browserCellRenderer(feature) {\n return (groups, { browser: browserId, version, caniuse }) => {\n const { name, type } = BROWSERS.get(browserId);\n const versionLong = version ? ` version ${version}` : \"\";\n const browserName = `${name}${versionLong}`;\n const supportLevel = statToText.get(caniuse);\n const ariaLabel = `${feature} is ${supportLevel} since ${browserName} on ${type}.`;\n const cssClass = `caniuse-cell ${caniuse}`;\n const title = capitalize(`${supportLevel} since ${browserName}.`);\n const textVersion = version ? version : \"—\";\n const src = getLogoSrc(browserId);\n const result = html`\n <div class=\"${cssClass}\" title=\"${title}\" aria-label=\"${ariaLabel}\">\n <img\n class=\"caniuse-browser\"\n width=\"20\"\n height=\"20\"\n src=\"${src}\"\n alt=\"${name} logo\"\n /><span class=\"browser-version\">${textVersion}</span>\n </div>\n `;\n groups.get(type).push(result);\n return groups;\n };\n}\n\n/**\n * @typedef {Record<string, [string, string[]][]>} ApiResponse\n * @throws {Error} on failure\n */\nasync function fetchStats(options) {\n const { feature, browsers, apiURL } = options;\n const url = new URL(apiURL || `./${feature}`, API_URL);\n browsers.forEach(browser => url.searchParams.append(\"browsers\", browser));\n const response = await fetch(url);\n if (!response.ok) {\n const { status, statusText } = response;\n throw new Error(`Failed to get caniuse data: (${status}) ${statusText}`);\n }\n return response.json();\n}\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.mdn {\n font-size: 0.75em;\n position: absolute;\n right: 0.3em;\n min-width: 0;\n margin-top: 3rem;\n}\n\n.mdn details {\n width: 100%;\n margin: 1px 0;\n position: relative;\n z-index: 10;\n box-sizing: border-box;\n padding: 0.4em;\n padding-top: 0;\n}\n\n.mdn details[open] {\n min-width: 25ch;\n max-width: 32ch;\n background: #fff;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n z-index: 11;\n margin-bottom: 0.4em;\n}\n\n.mdn summary {\n text-align: right;\n cursor: default;\n margin-right: -0.4em;\n}\n\n.mdn summary span {\n font-family: zillaslab, Palatino, \"Palatino Linotype\", serif;\n color: #fff;\n background-color: #000;\n display: inline-block;\n padding: 3px;\n}\n\n.mdn a {\n display: inline-block;\n word-break: break-all;\n}\n\n.mdn p {\n margin: 0;\n}\n\n.mdn .engines-all {\n color: #058b00;\n}\n.mdn .engines-some {\n color: #b00;\n}\n\n.mdn table {\n width: 100%;\n font-size: 0.9em;\n}\n\n.mdn td {\n border: none;\n}\n\n.mdn td:nth-child(2) {\n text-align: right;\n}\n\n.mdn .nosupportdata {\n font-style: italic;\n margin: 0;\n}\n\n.mdn tr::before {\n content: \"\";\n display: table-cell;\n width: 1.5em;\n height: 1.5em;\n background: no-repeat center center / contain;\n font-size: 0.75em;\n}\n\n.mdn .no,\n.mdn .unknown {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdn .no::before,\n.mdn .unknown::before {\n opacity: 0.5;\n}\n\n.mdn .chrome::before,\n.mdn .chrome_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/chrome/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/edge/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/firefox/firefox.svg);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/opera/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/safari/safari.svg);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/android-webview/android-webview.png);\n}\n`;\n","// @ts-check\nimport { fetchAndCache, getIntlData, showError } from \"./utils.js\";\nimport css from \"../styles/mdn-annotation.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/mdn-annotation\";\n\nconst BASE_JSON_PATH = \"https://w3c.github.io/mdn-spec-links/\";\nconst MDN_URL_BASE = \"https://developer.mozilla.org/en-US/docs/Web/\";\nconst MDN_BROWSERS = {\n // The browser IDs here must match the ones in the imported JSON data.\n // See the list of browser IDs at:\n // https://github.com/mdn/browser-compat-data/blob/master/schemas/compat-data-schema.md#browser-identifiers.\n chrome: \"Chrome\",\n chrome_android: \"Chrome Android\",\n edge: \"Edge\",\n edge_mobile: \"Edge Mobile\",\n firefox: \"Firefox\",\n firefox_android: \"Firefox Android\",\n // nodejs: \"Node.js\", // no data for features in HTML\n opera: \"Opera\",\n opera_android: \"Opera Android\",\n // qq_android: \"QQ Browser\", // not enough data for features in HTML\n safari: \"Safari\",\n safari_ios: \"Safari iOS\",\n samsunginternet_android: \"Samsung Internet\",\n // uc_android: \"UC browser\", // not enough data for features in HTML\n // uc_chinese_android: \"Chinese UC Browser\", // not enough data for features in HTML\n webview_android: \"WebView Android\",\n};\n\nconst localizationStrings = {\n en: {\n inAllEngines: \"This feature is in all major engines.\",\n inSomeEngines: \"This feature has limited support.\",\n },\n zh: {\n inAllEngines: \"所有主要引擎均支持此特性。\",\n inSomeEngines: \"此功能支持有限。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {HTMLElement} node\n */\nfunction insertMDNBox(node) {\n const targetAncestor = node.closest(\"section\");\n if (!targetAncestor) return;\n const { previousElementSibling: targetSibling } = targetAncestor;\n if (targetSibling && targetSibling.classList.contains(\"mdn\")) {\n // If the target ancestor already has a mdnBox inserted, we just use it\n return targetSibling;\n }\n const mdnBox = html`<aside class=\"mdn\"></aside>`;\n targetAncestor.before(mdnBox);\n return mdnBox;\n}\n\n/**\n * @param {MdnEntry} mdnSpec\n * @returns {HTMLDetailsElement}\n */\nfunction attachMDNDetail(mdnSpec) {\n const { name, slug, summary, support, engines } = mdnSpec;\n const mdnSubPath = slug.slice(slug.indexOf(\"/\") + 1);\n const href = `${MDN_URL_BASE}${slug}`;\n const label = `Expand MDN details for ${name}`;\n const engineSupport = getEngineSupportIcons(engines);\n return html`<details>\n <summary aria-label=\"${label}\"><span>MDN</span>${engineSupport}</summary>\n <a title=\"${summary}\" href=\"${href}\">${mdnSubPath}</a>\n ${getEngineSupport(engines)}\n ${support\n ? buildBrowserSupportTable(support)\n : html`<p class=\"nosupportdata\">No support data.</p>`}\n </details>`;\n}\n\n/**\n * @param {MdnEntry['support']} support\n * @returns {HTMLTableElement}\n */\nfunction buildBrowserSupportTable(support) {\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {\"Yes\" | \"No\" | \"Unknown\"} yesNoUnknown\n * @param {string} version\n * @returns {HTMLTableRowElement}\n */\n function createRow(browserId, yesNoUnknown, version) {\n const displayStatus = yesNoUnknown === \"Unknown\" ? \"?\" : yesNoUnknown;\n const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`;\n return html`<tr class=\"${classList}\">\n <td>${MDN_BROWSERS[browserId]}</td>\n <td>${version ? version : displayStatus}</td>\n </tr>`;\n }\n\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {VersionDetails} versionData\n */\n function createRowFromBrowserData(browserId, versionData) {\n if (versionData.version_removed) {\n return createRow(browserId, \"No\", \"\");\n }\n const versionAdded = versionData.version_added;\n if (typeof versionAdded === \"boolean\") {\n return createRow(browserId, versionAdded ? \"Yes\" : \"No\", \"\");\n } else if (!versionAdded) {\n return createRow(browserId, \"Unknown\", \"\");\n } else {\n return createRow(browserId, \"Yes\", `${versionAdded}+`);\n }\n }\n\n return html`<table>\n ${Object.keys(MDN_BROWSERS).map(browserId => {\n return support[browserId]\n ? createRowFromBrowserData(browserId, support[browserId])\n : createRow(browserId, \"Unknown\", \"\");\n })}\n </table>`;\n}\n\nexport async function run(conf) {\n const mdnKey = getMdnKey(conf);\n if (!mdnKey) return;\n\n const mdnSpecJson = await getMdnData(mdnKey, conf.mdn);\n if (!mdnSpecJson) return;\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.append(style);\n\n for (const elem of findElements(mdnSpecJson)) {\n const mdnSpecArray = mdnSpecJson[elem.id];\n const mdnBox = insertMDNBox(elem);\n if (!mdnBox) continue;\n for (const spec of mdnSpecArray) {\n mdnBox.append(attachMDNDetail(spec));\n }\n }\n}\n\n/** @returns {string} */\nfunction getMdnKey(conf) {\n const { shortName, mdn } = conf;\n if (!mdn) return;\n if (typeof mdn === \"string\") return mdn;\n return mdn.key || shortName;\n}\n\n/**\n * @param {string} key MDN key\n * @param {object} mdnConf\n * @param {string} [mdnConf.specMapUrl]\n * @param {string} [mdnConf.baseJsonPath]\n * @param {number} [mdnConf.maxAge]\n *\n * @typedef {{ version_added: string|boolean|null, version_removed?: string }} VersionDetails\n * @typedef {Record<string | keyof MDN_BROWSERS, VersionDetails>} MdnSupportEntry\n * @typedef {{ name: string, title: string, slug: string, summary: string, support: MdnSupportEntry, engines: string[] }} MdnEntry\n * @typedef {Record<string, MdnEntry[]>} MdnData\n * @returns {Promise<MdnData|undefined>}\n */\nasync function getMdnData(key, mdnConf) {\n const { baseJsonPath = BASE_JSON_PATH, maxAge = 60 * 60 * 24 * 1000 } =\n mdnConf;\n const url = new URL(`${key}.json`, baseJsonPath).href;\n const res = await fetchAndCache(url, maxAge);\n if (res.status === 404) {\n const msg = `Could not find MDN data associated with key \"${key}\".`;\n const hint = \"Please add a valid key to `respecConfig.mdn`\";\n showError(msg, name, { hint });\n return;\n }\n return await res.json();\n}\n\n/**\n * Find elements that can have an annotation box attached.\n * @param {MdnData} data\n */\nfunction findElements(data) {\n /** @type {NodeListOf<HTMLElement>} */\n const elemsWithId = document.body.querySelectorAll(\"[id]:not(script)\");\n return [...elemsWithId].filter(({ id }) => Array.isArray(data[id]));\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLSpanElement}\n */\nfunction getEngineSupportIcons(engines) {\n if (engines.length === 3) {\n return html`<span title=\"${l10n.inAllEngines}\">✅</span>`;\n }\n if (engines.length < 2) {\n return html`<span title=\"${l10n.inSomeEngines}\">🚫</span>`;\n }\n return html`<span> </span>`;\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLParagraphElement|undefined}\n */\nfunction getEngineSupport(engines) {\n if (engines.length === 3) {\n return html`<p class=\"engines-all\">${l10n.inAllEngines}</p>`;\n }\n if (engines.length < 2) {\n return html`<p class=\"engines-some\">${l10n.inSomeEngines}</p>`;\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"仕様検索\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"搜索 Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"🔎\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/xref/\";\n\nconst localizationStrings = {\n en: {\n title: \"Search definitions\",\n },\n ja: {\n title: \"定義検索\",\n },\n de: {\n title: \"Definitionen durchsuchen\",\n },\n zh: {\n title: \"搜索定义\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(l10n.title, show, \"Ctrl+Shift+Alt+x\", \"📚\");\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n const xrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=\"${onLoad}\"></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.title, xrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","// @ts-check\n// Module w3c/seo\n// Manages SEO information for documents\n// e.g. set the canonical URL for the document if configured\nimport { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { resolveRef } from \"../core/biblio.js\";\nimport { showWarning } from \"../core/utils.js\";\nexport const name = \"w3c/seo\";\n\nconst status2rdf = {\n NOTE: \"w3p:NOTE\",\n WD: \"w3p:WD\",\n LC: \"w3p:LastCall\",\n CR: \"w3p:CR\",\n CRD: \"w3p:CRD\",\n PR: \"w3p:PR\",\n REC: \"w3p:REC\",\n PER: \"w3p:PER\",\n RSCND: \"w3p:RSCND\",\n};\n\nexport const requiresCanonicalLink = new Set([\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n \"BG-FINAL\",\n \"CG-FINAL\",\n \"CRY\",\n \"DRY\",\n \"draft-finding\",\n \"finding\",\n]);\n\nexport async function run(conf) {\n // Don't include a canonical URL for documents that haven't been published.\n if (\n (!conf.canonicalURI && !requiresCanonicalLink.has(conf.specStatus)) ||\n !conf.shortName\n ) {\n return;\n }\n switch (conf.canonicalURI) {\n case \"edDraft\":\n if (conf.edDraftURI) {\n conf.canonicalURI = new URL(\n conf.edDraftURI,\n document.location.href\n ).href;\n } else {\n const msg = `Canonical URI set to edDraft, but no edDraftURI is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n case \"TR\":\n if (conf.latestVersion) {\n conf.canonicalURI = conf.latestVersion;\n } else {\n const msg = `Canonical URI set to TR, but no shortName is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n default:\n if (conf.latestVersion && !conf.canonicalURI) {\n conf.canonicalURI = conf.latestVersion;\n }\n }\n if (conf.canonicalURI) {\n const linkElem = html`<link rel=\"canonical\" href=\"${conf.canonicalURI}\" />`;\n document.head.appendChild(linkElem);\n }\n\n if (conf.doJsonLd) {\n await addJSONLDInfo(conf, document);\n }\n}\n\nasync function addJSONLDInfo(conf, doc) {\n const rdfStatus = status2rdf[conf.specStatus];\n // Content for JSON\n const type = [\"TechArticle\"];\n if (rdfStatus) type.push(rdfStatus);\n\n const jsonld = {\n \"@context\": [\n \"http://schema.org\",\n {\n \"@vocab\": \"http://schema.org/\",\n \"@language\": doc.documentElement.lang || \"en\",\n w3p: \"http://www.w3.org/2001/02pd/rec54#\",\n foaf: \"http://xmlns.com/foaf/0.1/\",\n datePublished: { \"@type\": \"http://www.w3.org/2001/XMLSchema#date\" },\n inLanguage: { \"@language\": null },\n isBasedOn: { \"@type\": \"@id\" },\n license: { \"@type\": \"@id\" },\n },\n ],\n id: conf.canonicalURI || conf.thisVersion,\n type,\n name: document.title,\n inLanguage: doc.documentElement.lang || \"en\",\n license: conf.licenseInfo?.url,\n datePublished: conf.dashDate,\n /** @type {{ name: string, url?: string } | { name: string, url?: string }[]} */\n copyrightHolder: {\n name: \"World Wide Web Consortium\",\n url: \"https://www.w3.org/\",\n },\n discussionUrl: conf.issueBase,\n alternativeHeadline: conf.subtitle,\n isBasedOn: conf.prevVersion,\n };\n\n // add any additional copyright holders\n if (conf.additionalCopyrightHolders) {\n const addl = Array.isArray(conf.additionalCopyrightHolders)\n ? conf.additionalCopyrightHolders\n : [conf.additionalCopyrightHolders];\n jsonld.copyrightHolder = [\n jsonld.copyrightHolder,\n ...addl.map(h => ({ name: h })),\n ];\n }\n\n // description from meta description\n const description = doc.head.querySelector(\"meta[name=description]\");\n if (description) {\n jsonld.description = description.content;\n }\n\n // Editors\n if (conf.editors) {\n jsonld.editor = conf.editors.map(addPerson);\n }\n if (conf.authors) {\n jsonld.contributor = conf.authors.map(addPerson);\n }\n\n // normative and informative references\n const citationIds = [\n ...conf.normativeReferences,\n ...conf.informativeReferences,\n ];\n const citationContents = await Promise.all(\n citationIds.map(ref => resolveRef(ref))\n );\n jsonld.citation = citationContents\n .filter(ref => typeof ref === \"object\")\n .map(addRef);\n\n const script = doc.createElement(\"script\");\n script.type = \"application/ld+json\";\n script.textContent = JSON.stringify(jsonld, null, 2);\n doc.head.appendChild(script);\n}\n\n/**\n * Turn editors and authors into a list of JSON-LD relationships\n */\nfunction addPerson({ name, url, mailto, company, companyURL }) {\n const ed = {\n type: \"Person\",\n name,\n url,\n \"foaf:mbox\": mailto,\n };\n if (company || companyURL) {\n ed.worksFor = {\n name: company,\n url: companyURL,\n };\n }\n return ed;\n}\n\n/**\n * Create a reference URL from the ref\n */\nfunction addRef(ref) {\n const { href: id, title: name, href: url } = ref;\n const jsonld = {\n id,\n type: \"TechArticle\",\n name,\n url,\n };\n if (ref.authors) {\n jsonld.creator = ref.authors.map(a => ({ name: a }));\n }\n if (ref.rawDate) {\n jsonld.publishedDate = ref.rawDate;\n }\n if (ref.isbn) {\n jsonld.identifier = ref.isbn;\n }\n if (ref.publisher) {\n jsonld.publisher = { name: ref.publisher };\n }\n return jsonld;\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${\"[testSuiteURI]\"} が見つかりません.`,\n tests: \"テスト\",\n test: \"テスト\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`本规范中包含测试,但在 ReSpec 配置中缺少 ${\"[testSuiteURI]\"}。`,\n tests: \"测试\",\n test: \"测试\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"🔒\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"💪\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n showError(l10n.missing_test_suite_uri, name);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","// @ts-check\n/**\n * This module adds a \"monetization\" meta-tag to enable web-monetization.\n *\n * The meta-tag is added only to \"live\" documents, and is removed from generated\n * static documents.\n */\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/web-monetization\";\n\nexport function run(conf) {\n if (conf.monetization === false) {\n return;\n }\n const { monetization } = conf;\n\n const { removeOnSave, paymentPointer } = canonicalizeConfig(monetization);\n\n const cssClass = removeOnSave ? \"removeOnSave\" : null;\n document.head.append(html`<meta\n name=\"monetization\"\n content=\"${paymentPointer}\"\n class=\"${cssClass}\"\n />`);\n}\n\n/**\n * @param {object|string} rawConfig\n * - {string} paymentPointer - The payment pointer to use.\n * - {boolean} removeOnSave - Whether to remove the meta tag when the document is saved.\n */\nfunction canonicalizeConfig(rawConfig) {\n const config = {\n paymentPointer: \"$respec.org\",\n removeOnSave: true,\n };\n switch (typeof rawConfig) {\n case \"string\":\n config.paymentPointer = rawConfig;\n break;\n case \"object\":\n if (rawConfig.paymentPointer) {\n config.paymentPointer = String(rawConfig.paymentPointer);\n }\n if (rawConfig.removeOnSave === false) {\n config.removeOnSave = false;\n }\n break;\n }\n return config;\n}\n","import { docLink, showError } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/before-save\";\n\nexport function run(conf) {\n if (!conf.beforeSave) return;\n\n if (\n !Array.isArray(conf.beforeSave) ||\n conf.beforeSave.some(\n el => typeof el !== \"function\" || el.constructor.name === \"AsyncFunction\"\n )\n ) {\n const msg = docLink`${\"[beforeSave]\"} configuration option must be an array of synchronous JS functions.`;\n showError(msg, name);\n return;\n }\n\n sub(\n \"beforesave\",\n documentElement => {\n performTransformations(conf.beforeSave, documentElement.ownerDocument);\n },\n { once: true }\n );\n}\n/**\n * @param {Array<Function>} transforms\n * @param {Document}\n */\nfunction performTransformations(transforms, doc) {\n let pos = 0;\n for (const fn of transforms) {\n try {\n fn(doc);\n } catch (err) {\n const nameOrPosition = `\\`${fn.name}\\`` || `at position ${pos}`;\n const msg = docLink`Function ${nameOrPosition}\\` threw an error during processing of ${\"[beforeSave]\"}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n } finally {\n pos++;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"check-internal-slots\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-internal-slots\";\nexport const name = \"core/linter-rules/check-internal-slots\";\n\nconst localizationStrings = {\n en: {\n msg: \"Internal slots should be preceded by a '.'\",\n hint: \"Add a '.' between the elements mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"var+a\");\n const offendingElements = [...elems].filter(\n ({ previousSibling: { nodeName } }) => {\n const isPrevVar = nodeName && nodeName === \"VAR\";\n return isPrevVar;\n }\n );\n\n if (!offendingElements.length) {\n return;\n }\n\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-captionless-tables\".\n *\n * Checks that there are no tables in the document which don't start\n * with a caption element.\n *\n * As some tables may not contain tabular data, this only applies to\n * tables marked with class=\"numbered\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-captionless-tables\";\nexport const name = \"core/linter-rules/no-captionless-tables\";\n\nconst localizationStrings = {\n en: {\n msg: \"All tables marked with class='numbered' must start with a caption element.\",\n hint: \"Add a `caption` to the offending table.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n const offendingElements = [...tables].filter(\n table => !(table.firstElementChild instanceof HTMLTableCaptionElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-dfns\".\n *\n * Complains if an internal/un-exported definitions is not linked to.\n */\nimport {\n docLink,\n getIntlData,\n norm,\n showError,\n showWarning,\n} from \"../utils.js\";\n\nconst ruleName = \"no-unused-dfns\";\nexport const name = \"core/linter-rules/no-unused-dfns\";\n\nconst localizationStrings = {\n en: {\n msg(text) {\n return `Found definition for \"${text}\", but nothing links to it. This is usually a spec bug!`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Add a \\`class=\"lint-ignore\"\\` attribute the definition.\n * Either remove the definition or change \\`<dfn>\\` to another type of HTML element.\n * If you meant to ${\"[export|#data-export]\"} the definition, add \\`class=\"export\"\\` to the definition.\n\n To silence this warning entirely, set \\`lint: { \"no-unused-dfns\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n /** @type NodeListOf<HTMLElement> */\n const definitions = document.querySelectorAll(\n \"dfn:not(.lint-ignore, [data-export], [data-cite])\"\n );\n\n const elements = [...definitions].filter(isDfnUnused);\n\n // These are usually bad spec bugs, so best shown individually.\n elements.forEach(element => {\n const elements = [element];\n const text = norm(element.textContent);\n logger(l10n.msg(text), name, { elements, hint: l10n.hint });\n });\n}\n\nfunction isDfnUnused(dfn) {\n // Not in the index\n // and not the \"self-link\" box\n return !document.querySelector(\n `a[href=\"#${dfn.id}\"]:not(.index-term, .self-link)`\n );\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * The W3C Process requires separate Privacy Considerations and Security\n * Considerations sections. This linter checks for the presence of these\n * sections, and reports an error if they are not present.\n */\n\nimport {\n InsensitiveStringSet,\n docLink,\n getIntlData,\n getIntlDataForKey,\n norm,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { W3CNotes, recTrackStatus } from \"../headers.js\";\n\nconst ruleName = \"required-sections\";\nexport const name = \"w3c/linter-rules/required-sections\";\n\nconst localizationStrings = {\n en: {\n msg(sectionTitle) {\n return `W3C Recommendation track documents require a separate \"${sectionTitle}\" section.`;\n },\n hint(sectionTitle) {\n return docLink`Add a \\`<section>\\` with a \"${sectionTitle}\" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n If the document is not intended for the W3C Recommendation track, set ${\"[noRecTrack]\"} to \\`true\\`\n or turn off the ${`[${ruleName}]`} linter rule.`;\n },\n privacy_considerations: \"Privacy Considerations\",\n security_considerations: \"Security Considerations\",\n },\n es: {\n msg(sectionTitle) {\n return `Documentos que van a ser \"W3C Recommendation\" requieren una sección \"${sectionTitle}\" separada.`;\n },\n hint(sectionTitle) {\n return docLink`Agrega una \\`<section>\\` con título \"${sectionTitle}\". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n Si el documento no está destinado a ser un W3C Recommendation, puedes poner ${\"[noRecTrack]\"} a \\`true\\`\n o apaga la regla de linter ${`[${ruleName}]`}.`;\n },\n privacy_considerations: \"Consideraciones de privacidad\",\n security_considerations: \"Consideraciones de Seguridad\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport const requiresSomeSectionStatus = new Set([...recTrackStatus]);\nrequiresSomeSectionStatus.delete(\"DISC\"); // \"Discontinued Draft\"\n// W3C notes do not require privacy or security considerations sections.\nW3CNotes.forEach(note => requiresSomeSectionStatus.delete(note));\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can't check for headers unless we also have a translation\n if (!getIntlDataForKey(localizationStrings, \"privacy_considerations\")) {\n // We can't check for headers unless we also have a translation\n const msg = `Cannot check for required sections as translations are not available.`;\n const hint = `File an issue to add translations or use a supported language.`;\n showWarning(msg, name, { hint });\n return;\n }\n\n if (conf.noRecTrack || !requiresSomeSectionStatus.has(conf.specStatus)) {\n return;\n }\n\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n const missingRequiredSections = new InsensitiveStringSet([\n l10n.privacy_considerations,\n l10n.security_considerations,\n ]);\n\n /** @type {NodeListOf<HTMLElement>} */\n const headers = document.querySelectorAll(\"h2, h3, h4, h5, h6\");\n for (const header of headers) {\n const clone = header.cloneNode(true);\n // section number and self-link anchor\n clone.querySelectorAll(\"bdi\")?.forEach(elem => elem.remove());\n const text = norm(clone.textContent);\n if (missingRequiredSections.has(text)) {\n missingRequiredSections.delete(text);\n // Check if we find them all...\n if (missingRequiredSections.size === 0) {\n return; // All present, early return!\n }\n }\n }\n\n // Show the ones we didn't find individually\n for (const title of missingRequiredSections) {\n logger(l10n.msg(title), name, {\n hint: l10n.hint(title),\n });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"wpt-tests-exist\".\n * Warns about nonexistent web platform tests.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"wpt-tests-exist\";\nexport const name = \"core/linter-rules/wpt-tests-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"The following test could not be found in Web Platform Tests:\",\n hint: \"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const filesInWPT = await getFilesInWPT(conf.testSuiteURI, conf.githubAPI);\n if (!filesInWPT) {\n return;\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n for (const elem of testables) {\n elem.dataset.tests\n .split(/,/gm)\n .map(test => test.trim().split(\"#\")[0])\n .filter(test => test && !filesInWPT.has(test))\n .map(missingTest => {\n showWarning(`${l10n.msg} \\`${missingTest}\\`.`, name, {\n hint: l10n.hint,\n elements: [elem],\n });\n });\n }\n}\n\n/**\n * @param {string} testSuiteURI\n * @param {string} githubAPIBase\n */\nasync function getFilesInWPT(testSuiteURI, githubAPIBase) {\n let wptDirectory;\n try {\n const testSuiteURL = new URL(testSuiteURI);\n if (\n testSuiteURL.pathname.startsWith(\"/web-platform-tests/wpt/tree/master/\")\n ) {\n const re = /web-platform-tests\\/wpt\\/tree\\/master\\/(.+)/;\n wptDirectory = testSuiteURL.pathname.match(re)[1].replace(/\\//g, \"\");\n } else {\n wptDirectory = testSuiteURL.pathname.replace(/\\//g, \"\");\n }\n } catch (error) {\n const msg = \"Failed to parse WPT directory from testSuiteURI\";\n showWarning(msg, `linter/${name}`);\n console.error(error);\n return null;\n }\n\n const url = new URL(\"web-platform-tests/wpt/files\", `${githubAPIBase}/`);\n url.searchParams.set(\"path\", wptDirectory);\n\n const response = await fetch(url);\n if (!response.ok) {\n const error = await response.text();\n const msg =\n \"Failed to fetch files from WPT repository. \" +\n `Request failed with error: ${error} (${response.status})`;\n showWarning(msg, `linter/${name}`);\n return null;\n }\n /** @type {{ entries: string[] }} */\n const { entries } = await response.json();\n const files = entries.filter(entry => !entry.endsWith(\"/\"));\n return new Set(files);\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n","// @ts-check\n/**\n * Lints for accessibility issues using axe-core package.\n */\n\nimport { showError, showWarning } from \"../utils.js\";\n\nexport const name = \"core/linter-rules/a11y\";\n\nconst DISABLED_RULES = [\n \"color-contrast\", // too slow 🐢\n \"landmark-one-main\", // need to add a <main>, else it marks entire page as errored\n \"landmark-unique\",\n \"region\",\n];\n\nexport async function run(conf) {\n if (!conf.lint?.a11y && /** legacy */ !conf.a11y) {\n return;\n }\n const config = conf.lint?.a11y || /** legacy */ conf.a11y;\n\n const options = config === true ? {} : config;\n const violations = await getViolations(options);\n for (const violation of violations) {\n /**\n * We're grouping by failureSummary as it contains hints to fix the issue.\n * For example, with color-constrast rule, it tells about the present color\n * contrast and how to fix it. If we don't group, errors will be repetitive.\n * @type {Map<string, HTMLElement[]>}\n */\n const groupedBySummary = new Map();\n for (const node of violation.nodes) {\n const { failureSummary, element } = node;\n const elements =\n groupedBySummary.get(failureSummary) ||\n groupedBySummary.set(failureSummary, []).get(failureSummary);\n elements.push(element);\n }\n\n const { id, help, description, helpUrl } = violation;\n const title = `a11y/${id}: ${help}.`;\n for (const [failureSummary, elements] of groupedBySummary) {\n const hints = formatHintsAsMarkdown(failureSummary);\n const details = `\\n\\n${description}.\\n\\n${hints}. ([Learn more](${helpUrl}))`;\n showWarning(title, name, { details, elements });\n }\n }\n}\n\n/**\n * @param {object} opts Options as described at https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter\n */\nasync function getViolations(opts) {\n const { rules, ...otherOptions } = opts;\n const options = {\n rules: {\n ...Object.fromEntries(DISABLED_RULES.map(id => [id, { enabled: false }])),\n ...rules,\n },\n ...otherOptions,\n elementRef: true,\n resultTypes: [\"violations\"],\n reporter: \"v1\", // v1 includes a `failureSummary`\n };\n\n let axe;\n try {\n axe = await importAxe();\n } catch (error) {\n const msg = \"Failed to load a11y linter.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n\n try {\n const result = await axe.run(document, options);\n return result.violations;\n } catch (error) {\n const msg = \"Error while looking for a11y issues.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n}\n\n/** @returns {Promise<typeof window.axe>} */\nfunction importAxe() {\n const script = document.createElement(\"script\");\n script.classList.add(\"remove\");\n script.src = \"https://unpkg.com/axe-core@4/axe.min.js\";\n document.head.appendChild(script);\n return new Promise((resolve, reject) => {\n script.onload = () => resolve(window.axe);\n script.onerror = reject;\n });\n}\n\n/** @param {string} text */\nfunction formatHintsAsMarkdown(text) {\n const results = [];\n for (const group of text.split(\"\\n\\n\")) {\n const [msg, ...opts] = group.split(/^\\s{2}/m);\n const options = opts.map(opt => `- ${opt.trimEnd()}`).join(\"\\n\");\n results.push(`${msg}${options}`);\n }\n return results.join(\"\\n\\n\");\n}\n","// @ts-check\n/**\n * Linter rule \"informative-dfn\".\n *\n * Complains if an informative definition is referenced from a normative section.\n */\nimport { docLink, getIntlData, showError, showWarning } from \"../utils.js\";\n\nimport { informativeRefsInNormative } from \"../xref.js\";\n\nconst ruleName = \"informative-dfn\";\nexport const name = \"core/linter-rules/informative-dfn\";\n\nconst localizationStrings = {\n en: {\n msg(term, cite) {\n return `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Get the source definition to be made normative\n * Add a \\`class=\"lint-ignore\"\\` attribute to the link.\n * Use a local normative proxy for the definition à la \\`<dfn data-cite=\"spec\">term</dfn>\\`\n\n To silence this warning entirely, set \\`lint: { \"${ruleName}\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n informativeRefsInNormative.forEach(({ term, spec, element }) => {\n if (element.classList.contains(\"lint-ignore\")) return;\n logger(l10n.msg(term, spec), name, {\n title: \"Normative reference to non-normative term.\",\n elements: [element],\n hint: l10n.hint,\n });\n });\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","source","position","current","message","kind","level","autofix","ruleName","sliceTokens","count","slice","Math","max","tokensToText","inputs","precedes","text","t","trivia","join","nextToken","type","length","line","precedingLastLine","splitted","split","lastLine","subsequentTokens","subsequentText","sourceContext","repeat","contextType","context","partial","node","hierarchy","unshift","n","base","appendIfExist","contextAsText","bareMessage","sourceName","input","tokens","syntaxError","validationError","token","Base","constructor","Object","defineProperties","writable","toJSON","json","inheritance","proto","descMap","getOwnPropertyDescriptors","key","entries","enumerable","getPrototypeOf","idlTypeIncludesDictionary","idlType","defs","useNullableInner","union","def","unique","typedefIncludesDictionary","cache","reference","dictionary","nullable","subtype","dictionaryIncludesRequiredField","dict","members","field","required","superdict","ArrayBase","Array","super","WrappedToken","static","tokeniser","consumeKind","unescape","write","w","ts","separator","Eof","tokenName","list","parser","listName","extAttrValueSyntax","renamedLegacies","extAttrListItems","syntax","toks","ExtendedAttributeParameters","assign","consume","ret","autoParenter","asterisk","secondaryName","rhsIsList","argument_list","close","rhsType","reference_token","p","identifier","SimpleExtendedAttribute","params","parse","defineProperty","rhs","arguments","validate","extAttr","arg","extendedAttribute","extendedAttributeReference","ExtendedAttributes","push","unconsume","probe","ea","type_suffix","obj","single_type","typeName","Type","return_type","type_with_extended_attributes","keyType","stringTypes","keyIdlType","valueType","generic_type","primitive_type","typeNameKeywords","generic","typ","or","union_type","extAttrs","Boolean","prefix","postfix","filter","typedef","targetToken","firstToken","ref","unescaped","type_body","Default","const_value","expression","const_data","negative","Argument","start_position","optional","variadic","argumentNameKeywords","default","autofixOptionalDictionaryDefaultValue","indexOf","a","isLastRequiredArgument","getFirstToken","name_token","data","Tokeniser","Operation","special","regular","termination","argument","body","definition","nameless","Attribute","noInherit","readonly","startsWith","allowDangler","first","items","item","num_type","integer_type","decimal_type","voidToken","stringifier","getLastIndentation","str","lines","match","autofixAddExposedWindow","exposed","existing","test","values","x","y","isArray","tokenRe","decimal","integer","string","whitespace","comment","other","nonRegexTerminals","concat","punctuations","reserved","idl","lastCharIndex","nextChar","charAt","attemptTokenMatch","noFlushTrivia","currentTrivia","pop","lastIndex","WebIDLParseError","punctuation","re","exec","tokenise","probeKind","candidates","consumeIdentifier","EnumValue","Enum","v","Includes","mixin","Typedef","CallbackFunction","Container","instance","inheritable","allowedMembers","colon","mem","member","m","Constant","IterableLike","secondTypeRequired","secondTypeAllowed","argumentAllowed","argsOpen","argsClose","Constructor","static_member","Interface","every","oldConstructors","autofixConstructor","factoryFunctions","named","constructors","i","opNames","ops","getOperations","statics","Set","op","nonstatics","groupOperationNames","partials","mixins","mixinMap","ext","additions","checkAdditions","forEach","add","existings","addition","checkInterfaceMemberDuplication","interfaceDef","constructorExtAttr","indentation","memberIndent","parentTrivia","indentCh","getMemberIndentation","constructorOp","existingIndex","array","predicate","reverse","findIndex","findLastIndex","splice","removed","trim","Mixin","Field","Dictionary","Namespace","CallbackInterface","parseByTokens","interface_","opts","productions","production","res","eof","concrete","definitions","noop","templates","Writer","raw","wrapper","bind","id","getMixinMap","include","validateIterable","ast","duplicates","groupDefinitions","dup","checkDuplicatedNames","flat","it","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","paramName","paramValue","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","_","fromCharCode","parseInt","substring","caret","edit","regex","opt","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","href","prot","decodeURIComponent","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","merge","hasOwnProperty","splitCells","tableRow","cells","offset","escaped","curr","invert","l","suffLen","currChar","checkSanitizeDeprecation","console","warn","repeatString","pattern","outputLink","cap","link","lexer","title","state","inLink","inlineTokens","Tokenizer","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","matchIndentInNode","indentInNode","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","istask","ischecked","indent","blankLine","endsWithBlankLine","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","itemRegex","trimLeft","search","nextBulletRegex","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","hasMultipleLineBreaks","pre","tag","table","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","create","inlineQueue","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","getStartIndex","errMsg","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","dryrun","Parser","Renderer","textRenderer","parseInline","l2","l3","cell","itemBody","renderers","marked","err","pending","setTimeout","onError","setOptions","newDefaults","use","childTokens","pack","prevRenderer","prevTokenizer","lexInline","globalThis","global","module","pluralizeExports","exports","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","r","delete","configurable","o","s","WeakSet","u","insertBefore","selected","selectedIndex","f","querySelectorAll","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","g","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","TypeError","parserMode","inputArray","from","char","trimEnd","fromEntries","parseMimeType","parameters","essence","mimeType","size","paramStr","_pluralize","webidl2","_webidl2","reindent","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","xmlEscape","norm","getIntlData","localizationStrings","getIntlDataForKey","concatDate","date","sep","format","runTransforms","flist","funcArgs","methods","meth","showWarning","fetchAndCache","maxAge","Request","cachedResponse","caches","Date","headers","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","toISOString","cacheResponse","Response","blob","put","htmlJoinComma","joined","htmlJoinAnd","addHashId","hash","imul","hashString","addId","pfx","txt","noLC","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","getPreviousSections","sections","previous","previousElementSibling","iteratePreviousElements","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","getCanonicalKey","existingKey","find","makeSafeCopy","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","elements","msg","markAsOffending","details","showError","pluginName","toMDCode","codedJoinOr","quotes","addQuotes","codedJoinAnd","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$p","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$D","group","style$1","github$1","dataInclude","markdown","reindent$1","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","tables","webidl","biblio$1","linkToDfn","xref","dataCite","renderBiblio","dfnIndex","contrib","fixHeaders","webidlIndex","structure","informative","idHeaders","caniuse","mdnAnnotation","saveHtml","searchSpecref","searchXref","aboutRespec","seo$1","seo","webidlClipboard","dataTests","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","webMonetization","beforeSave","checkCharset","checkPunctuation","checkInternalSlots","localRefsExist","noCaptionlessTables","noUnusedDfns","noHeadinglessSections","noUnusedVars","requiredSections","wptTestsExist","noHttpProps","a11y","informativeDfn","ReSpec.run","hasLink","isLegacyFrag","getGroupDetails","shortname","wgId","wg","patentURI","wgPatentURI","patentPolicy","wgPatentPolicy","groupType","wgURI","status","groupDetails","groups","getMultipleGroupDetails","showLink","class","showLinkData","showLogo","logo","alt","height","width","until","es","ko","ja","zh","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","reduce","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","extras","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","archives","author","authors","commit_history","edited_in_place","editor","editors","feedback","former_editor","former_editors","history","implementation_report","latest_editors_draft","latest_published_version","latest_recommendation","message_topic","more_details_about_this_doc","multiple_alternates","prev_editor_draft","prev_recommendation","prev_version","publication_history","test_suite","this_version","with_subject_line","your_topic_here","nl","getSpecSubTitleElem","specSubTitleElem","subtitle","headersTmpl","logos","specType","isCR","isCRY","longStatus","textStatus","prependW3C","specStatus","dashDate","publishDate","modificationDate","renderSpecTitle","localStorage","getItem","thisVersion","latestVersion","edDraftURI","historyURI","github","commitHistoryURL","testSuiteURI","implementationReportURI","prevED","showPreviousVersion","prevVersion","prevRecURI","isRec","formerEditors","wgPublicList","renderFeedback","errata","otherLinks","shortName","alternateFormats","multipleAlternates","alternatesHTML","existingCopyright","isUnofficial","licenseInfo","copyrightStart","publishYear","additionalCopyrightHolders","short","linkLicense","renderOfficialCopyright","renderCopyright","repoURL","issuesURL","newIssuesURL","pullsURL","fullName","mailToURL","subject","subjectPrefix","mailingListLink","subjectLine","emailSubject","archiveURL","archiveLink","cgbgHeadersTmpl","specTitleElem","specTitleElemClone","isCGFinal","sotd","status_at_publication","processLink","sotdTmpl","isPreview","renderPreview","additionalContent","renderIsUnofficial","isTagFinding","isNoTrack","isMO","renderIsNoTrack","isMemberSubmission","teamComment","getUTCFullYear","submissionCommentNumber","patentPolicyURL","noteForMemberSubmission","noteForSubmission","sotdAfterWGinfo","overrideStatus","changes","revisionTypes","pa","pc","ca","cc","track","status2track","wgHTML","linkToWorkingGroup","updateableRec","revisedRecEnd","reviewTarget","renderIsRec","statusExplanation","reviewPolicy","endorsement","updatePolicy","lsUpdatePolicy","pubMode","humanPREnd","humanCREnd","crEnd","prEnd","renderNotRec","isNote","isRegistry","multipleWGs","wgPatentHTML","producers","renderDeliverer","additionalSections","prUrl","prNumber","cgbgSotdTmpl","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","renderPublicList","issueBase","linkToCommunity","w3Url","status2maturity","LS","LD","FPWD","status2text","DNOTE","NOTE","STMT","MO","ED","WD","CR","CRD","PR","PER","REC","DISC","RSCND","DRY","CRYD","CRY","RY","unofficial","UD","finding","status2long","W3CNotes","recTrackStatus","registryTrackStatus","tagStatus","cgStatus","bgStatus","cgbgStatus","trStatus","noTrackStatus","licenses","patentPolicies","validateDateAndRecover","fallbackDate","isFinite","formattedDate","collectSotdContent","sotdClone","hasChildNodes","isBasic","isCGBG","isCRDraft","isEd","isPER","isPR","isRecTrack","isRegular","isTagEditorFinding","license","lCaseLicense","deriveLicenseInfo","lastModified","pubSpace","derivePubSpace","maturity","docVersion","reportType","latestVersionURL","validateCGBG","validateIfAllowedOnTR","latestPath","previousPublishDate","previousMaturity","prevMaturity","pubDate","prevPubDate","prevRecShortname","uri","publishISODate","shortISODate","policies","policy","validatePatentPolicies","canShowHistory","historyURL","deriveHistoryURI","wgPotentialArray","idx","isPr","perEnd","contains","noRecTrack","notAllowed","mailToWGPublicList","populateSoTD","generatedSubtitle","coreDefaults","lint","highlightVars","addSectionLinks","w3cLogo","memSubmissionLogo","w3cDefaults","doJsonLd","excludeGithubLinks","supportedStatus","validateStatusForGroup","isWgStatus","inWorkingGroup","doesNotNeedWG","processLogos","css$n","noReSpecCSS","attachFixupScript","resourceHints","createResourceHints","canonicalStatus","styleFile","canUseW3CStyle","noToc","finalStyleURL","linkURL","urls","frag","nextLink","linkCSS","exportDoc","w3cStyle","resolveGithubPromise","rejectGithubPromise","file_a_bug","participate","ghURL","tempURL","org","repo","branch","newProps","githubToken","githubUser","atRiskBase","pullBase","githubAPI","hostname","otherLink","normalizedGHObj","apiBase","normalizedConfig","DOMBuilder","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","includeId","default_title","h1Elem","isConnected","tempElem","documentTitle","setDocumentTitle","isInteger","searchString","findAbstract","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","renderParent","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","promisesToAdd","flatMap","isInDB","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","terms","processConformance","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$l","makeTitle","num","report","number","div","inAside","exampleTitle","css$j","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","decorateTableOfFigures","list_of_tables","listOfTables","decorateTable","tableId","listOfTablesCaption","getListOfTablesListItem","collectTables","listOfTablesElement","decorateListOfTables","topLevelEntities","findDfn","defn","findNormalDfn","findOperationDfn","resolvedName","dfns","getDfns","alternativeDfns","decorateDfn","dfnElem","idlAst","lCaseParent","last","getDataType","local","exportable","addAlternativeNames","asQualifiedName","asMethodName","asFullyQualifiedName","asMethodWithArgs","operationName","argsAst","operationNames","isOptional","requiredArgs","requiredOperation","optionalOps","generateMethodNamesWithArgs","getAlternativeNames","originalName","foundDfns","dfnForArray","closestDfnFor","idlStruct","copyButton","createButton","addCopyIDLButton","idlHeader","idlText","clipboard","writeText","css$h","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","isDefaultJSON","unlinkedAnchor","nameResolverMap","getDefnName","getIdlId","resolvePartial","overload","qualifiedName","fullyQualifiedName","resolveOverload","resolveNameAndId","topLevelIdlTypes","renderWebIDL","idlElement","highlights","closestCite","cites","addIDLHeader","idls","astArray","validations","validation","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","STORE_NAME","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","queries","cachedData","lastChecked","setItem","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","query","cursor","profiles","informativeRefsInNormative","getRequestEntry","getTermFromElement","specs","dataciteElem","closestSection","inlineRefs","higherPriority","uniqueSpecs","dedupeSpecContext","getSpecContext","types","getTypeContext","dataXrefForElem","getForContext","addDataCite","normative","closestNormative","closestInform","addToReferences","objectHash","buffer","TextEncoder","crypto","subtle","digest","bufferToHexString","Uint8Array","padStart","invalidProfileError","profile","normalizeConfig","bodyCite","externalDFNs","findExplicitExternalLinks","queryKeys","apiUrl","uniqueIds","uniqueQueryKeys","resultsFromCache","termsToLook","fetchedResults","fetchFromNetwork","cacheXrefData","getData","ambiguous","notFound","collector","getPrefilledFormURL","howToFix","howToCiteURL","originalTerm","formUrl","specsString","forParent","showErrors","addDataCiteToTerms","css$f","headingExternal","headlingLocal","dfnOf","CODE_TYPES","getLocalTermType","ds","getLocalTermParentContext","getLocalTermSuffix","appendSectionNumbers","secNum","getSectionNumber","collectExternalTerms","uniqueReferences","uniqueID","renderExternalTermEntry","typeSuffix","TYPE_TERMS","TYPED_TYPES","linkForText","getTermText","styleEl","localTermIndex","dataSortedByTerm","collectLocalTerms","renderItem","suffix","getLocalTermText","renderLocalTerm","createLocalTermIndex","externalTermIndex","dataSortedBySpec","specA","specB","createExternalTermIndex","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","showContributors","getParents","idlIndexSec","idlIndex","lowerHeaderTags","toc","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","css$d","BROWSERS","statToText","defaultBrowsers","DEFAULTS","removeOnSave","browsers","feature","normalizeCaniuseConf","invalidBrowsers","browser","validateBrowsers","featureURL","headDlElem","contentPromise","statusText","fetchStats","toBrowserCell","browserId","browserName","supportLevel","cssClass","textVersion","getLogoSrc","browserCellRenderer","processJson","handleError","definitionPair","outputDoc","css$b","BASE_JSON_PATH","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","opera","opera_android","safari","safari_ios","samsunginternet_android","webview_android","inAllEngines","inSomeEngines","insertMDNBox","targetAncestor","targetSibling","mdnBox","attachMDNDetail","mdnSpec","summary","support","engines","mdnSubPath","engineSupport","getEngineSupportIcons","getEngineSupport","createRow","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","getMdnData","findElements","mdnSpecArray","save_snapshot","downloadLinks","epubURL","saveDialog","filename","toDownloadLink","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","status2rdf","LC","requiresCanonicalLink","addPerson","ed","worksFor","addRef","jsonld","creator","publishedDate","isbn","canonicalURI","rdfStatus","w3p","foaf","datePublished","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","description","contributor","citationIds","citationContents","citation","addJSONLDInfo","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","handleDuplicates","testURLs","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","css$5","varMap","variables","currentSection","textNode","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","monetization","paymentPointer","rawConfig","canonicalizeConfig","transforms","pos","performTransformations","metas","meta","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLTableCaptionElement","isDfnUnused","logger","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","sectionTitle","privacy_considerations","security_considerations","requiresSomeSectionStatus","missingRequiredSections","filesInWPT","githubAPIBase","wptDirectory","testSuiteURL","files","getFilesInWPT","missingTest","offendingMembers","getOwnPropertyNames","DISABLED_RULES","formatHintsAsMarkdown","violations","otherOptions","enabled","elementRef","resultTypes","reporter","axe","onload","onerror","importAxe","getViolations","violation","groupedBySummary","nodes","failureSummary","help","helpUrl","hints"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAA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IAAIqjF,EAAgB,IAAI9jF,IAAI8jF,IACtC12E,KAAK20B,EACf,CAED,MAAMloB,GAAEA,EAAEkqE,KAAEA,EAAIpL,YAAEA,EAAWqL,QAAEA,GAAYL,EACrC/jE,EAAQ,QAAQ/F,MAAOkqE,KAC7B,IAAK,MAAOD,EAAgB1/C,KAAaw/C,EAAkB,CACzD,MAAMK,EAAQlB,GAAsBe,GAEpCjlD,GAAYjf,EAAOxiB,GAAM,CAAEmnC,QADX,OAAOo0C,SAAmBsL,oBAAwBD,MAC9B5/C,YACrC,CACF,CACH,ICtCA,MAAM5+B,GAAW,kBACJpI,GAAO,oCAmBdgC,GAAO6+B,GAjBe,CAC1B3+B,GAAI,CACF+kC,IAAG,CAAC8iC,EAAM7R,IACD,2BAA2B6R,oDAAuD7R,MAEvF14B,WACF,OAAOmI,EAAO;;;;;;;2DAOuCv/B,0CACtD,sDAKE,SAAawkC,GAClB,IAAKA,EAAK6b,OAAOrgD,IAAW,OAC5B,MAAMk8E,EAAiC,UAAxB13C,EAAK6b,KAAKrgD,IAAwBg/B,GAAY3F,GAE7DgqC,GAA2B1xD,SAAQ,EAAGgwD,OAAM9R,OAAMtzB,cAC5CA,EAAQ9E,UAAUqoB,SAAS,gBAC/Bo8B,EAAOtiF,GAAKilC,IAAI8iC,EAAM9R,GAAOj4D,GAAM,CACjCwiB,MAAO,6CACPwkB,SAAU,CAACrC,GACXnF,KAAMx9B,GAAKw9B,MACX,GAEN","x_google_ignoreList":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,40]} \ No newline at end of file +{"version":3,"file":"respec-w3c.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../node_modules/webidl2/lib/error.js","../node_modules/webidl2/lib/productions/base.js","../node_modules/webidl2/lib/validators/helpers.js","../node_modules/webidl2/lib/productions/array-base.js","../node_modules/webidl2/lib/productions/token.js","../node_modules/webidl2/lib/productions/extended-attributes.js","../node_modules/webidl2/lib/productions/type.js","../node_modules/webidl2/lib/productions/default.js","../node_modules/webidl2/lib/productions/argument.js","../node_modules/webidl2/lib/productions/operation.js","../node_modules/webidl2/lib/productions/attribute.js","../node_modules/webidl2/lib/productions/helpers.js","../node_modules/webidl2/lib/tokeniser.js","../node_modules/webidl2/lib/productions/enum.js","../node_modules/webidl2/lib/productions/includes.js","../node_modules/webidl2/lib/productions/typedef.js","../node_modules/webidl2/lib/productions/callback.js","../node_modules/webidl2/lib/productions/container.js","../node_modules/webidl2/lib/productions/constant.js","../node_modules/webidl2/lib/productions/iterable.js","../node_modules/webidl2/lib/productions/constructor.js","../node_modules/webidl2/lib/productions/interface.js","../node_modules/webidl2/lib/validators/interface.js","../node_modules/webidl2/lib/productions/mixin.js","../node_modules/webidl2/lib/productions/field.js","../node_modules/webidl2/lib/productions/dictionary.js","../node_modules/webidl2/lib/productions/namespace.js","../node_modules/webidl2/lib/productions/callback-interface.js","../node_modules/webidl2/lib/webidl2.js","../node_modules/webidl2/lib/writer.js","../node_modules/webidl2/lib/validator.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/reindent.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/w3c.js","../src/core/location-hash.js","../src/w3c/group.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/w3c/templates/headers.js","../src/w3c/templates/cgbg-headers.js","../src/w3c/templates/sotd.js","../src/w3c/templates/cgbg-sotd.js","../src/w3c/headers.js","../src/core/defaults.js","../src/w3c/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/w3c/style.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/w3c/level.js","../src/w3c/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/w3c/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/tables.js","../src/core/dfn-finder.js","../src/core/webidl-clipboard.js","../src/styles/webidl.css.js","../src/core/webidl.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/xref-db.js","../src/core/xref.js","../src/styles/dfn-index.css.js","../src/core/dfn-index.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/webidl-index.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/styles/caniuse.css.js","../src/core/caniuse.js","../src/styles/mdn-annotation.css.js","../src/core/mdn-annotation.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/search-xref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/w3c/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/web-monetization.js","../src/core/before-save.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/check-internal-slots.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-captionless-tables.js","../src/core/linter-rules/no-unused-dfns.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/w3c/linter-rules/required-sections.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.js","../src/core/linter-rules/informative-dfn.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\nif (html && !html.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html.lang;\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/**\n * @param {string} text\n */\nfunction lastLine(text) {\n const splitted = text.split(\"\\n\");\n return splitted[splitted.length - 1];\n}\n\nfunction appendIfExist(base, target) {\n let result = base;\n if (target) {\n result += ` ${target}`;\n }\n return result;\n}\n\nfunction contextAsText(node) {\n const hierarchy = [node];\n while (node && node.parent) {\n const { parent } = node;\n hierarchy.unshift(parent);\n node = parent;\n }\n return hierarchy.map((n) => appendIfExist(n.type, n.name)).join(\" -> \");\n}\n\n/**\n * @typedef {object} WebIDL2ErrorOptions\n * @property {\"error\" | \"warning\"} [level]\n * @property {Function} [autofix]\n * @property {string} [ruleName]\n *\n * @typedef {ReturnType<typeof error>} WebIDLErrorData\n *\n * @param {string} message error message\n * @param {*} position\n * @param {*} current\n * @param {*} message\n * @param {\"Syntax\" | \"Validation\"} kind error type\n * @param {WebIDL2ErrorOptions=} options\n */\nfunction error(\n source,\n position,\n current,\n message,\n kind,\n { level = \"error\", autofix, ruleName } = {}\n) {\n /**\n * @param {number} count\n */\n function sliceTokens(count) {\n return count > 0\n ? source.slice(position, position + count)\n : source.slice(Math.max(position + count, 0), position);\n }\n\n /**\n * @param {import(\"./tokeniser.js\").Token[]} inputs\n * @param {object} [options]\n * @param {boolean} [options.precedes]\n * @returns\n */\n function tokensToText(inputs, { precedes } = {}) {\n const text = inputs.map((t) => t.trivia + t.value).join(\"\");\n const nextToken = source[position];\n if (nextToken.type === \"eof\") {\n return text;\n }\n if (precedes) {\n return text + nextToken.trivia;\n }\n return text.slice(nextToken.trivia.length);\n }\n\n const maxTokens = 5; // arbitrary but works well enough\n const line =\n source[position].type !== \"eof\"\n ? source[position].line\n : source.length > 1\n ? source[position - 1].line\n : 1;\n\n const precedingLastLine = lastLine(\n tokensToText(sliceTokens(-maxTokens), { precedes: true })\n );\n\n const subsequentTokens = sliceTokens(maxTokens);\n const subsequentText = tokensToText(subsequentTokens);\n const subsequentFirstLine = subsequentText.split(\"\\n\")[0];\n\n const spaced = \" \".repeat(precedingLastLine.length) + \"^\";\n const sourceContext = precedingLastLine + subsequentFirstLine + \"\\n\" + spaced;\n\n const contextType = kind === \"Syntax\" ? \"since\" : \"inside\";\n const inSourceName = source.name ? ` in ${source.name}` : \"\";\n const grammaticalContext =\n current && current.name\n ? `, ${contextType} \\`${current.partial ? \"partial \" : \"\"}${contextAsText(\n current\n )}\\``\n : \"\";\n const context = `${kind} error at line ${line}${inSourceName}${grammaticalContext}:\\n${sourceContext}`;\n return {\n message: `${context} ${message}`,\n bareMessage: message,\n context,\n line,\n sourceName: source.name,\n level,\n ruleName,\n autofix,\n input: subsequentText,\n tokens: subsequentTokens,\n };\n}\n\n/**\n * @param {string} message error message\n */\nexport function syntaxError(source, position, current, message) {\n return error(source, position, current, message, \"Syntax\");\n}\n\n/**\n * @param {string} message error message\n * @param {WebIDL2ErrorOptions} [options]\n */\nexport function validationError(\n token,\n current,\n ruleName,\n message,\n options = {}\n) {\n options.ruleName = ruleName;\n return error(\n current.source,\n token.index,\n current,\n message,\n \"Validation\",\n options\n );\n}\n","export class Base {\n /**\n * @param {object} initializer\n * @param {Base[\"source\"]} initializer.source\n * @param {Base[\"tokens\"]} initializer.tokens\n */\n constructor({ source, tokens }) {\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens, writable: true },\n parent: { value: null, writable: true },\n this: { value: this }, // useful when escaping from proxy\n });\n }\n\n toJSON() {\n const json = { type: undefined, name: undefined, inheritance: undefined };\n let proto = this;\n while (proto !== Object.prototype) {\n const descMap = Object.getOwnPropertyDescriptors(proto);\n for (const [key, value] of Object.entries(descMap)) {\n if (value.enumerable || value.get) {\n // @ts-ignore - allow indexing here\n json[key] = this[key];\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return json;\n }\n}\n","/**\n * @typedef {import(\"../productions/dictionary.js\").Dictionary} Dictionary\n *\n * @param {*} idlType\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {object} [options]\n * @param {boolean} [options.useNullableInner] use when the input idlType is nullable and you want to use its inner type\n * @return {{ reference: *, dictionary: Dictionary }} the type reference that ultimately includes dictionary.\n */\nexport function idlTypeIncludesDictionary(\n idlType,\n defs,\n { useNullableInner } = {}\n) {\n if (!idlType.union) {\n const def = defs.unique.get(idlType.idlType);\n if (!def) {\n return;\n }\n if (def.type === \"typedef\") {\n const { typedefIncludesDictionary } = defs.cache;\n if (typedefIncludesDictionary.has(def)) {\n // Note that this also halts when it met indeterminate state\n // to prevent infinite recursion\n return typedefIncludesDictionary.get(def);\n }\n defs.cache.typedefIncludesDictionary.set(def, undefined); // indeterminate state\n const result = idlTypeIncludesDictionary(def.idlType, defs);\n defs.cache.typedefIncludesDictionary.set(def, result);\n if (result) {\n return {\n reference: idlType,\n dictionary: result.dictionary,\n };\n }\n }\n if (def.type === \"dictionary\" && (useNullableInner || !idlType.nullable)) {\n return {\n reference: idlType,\n dictionary: def,\n };\n }\n }\n for (const subtype of idlType.subtype) {\n const result = idlTypeIncludesDictionary(subtype, defs);\n if (result) {\n if (subtype.union) {\n return result;\n }\n return {\n reference: subtype,\n dictionary: result.dictionary,\n };\n }\n }\n}\n\n/**\n * @param {*} dict dictionary type\n * @param {import(\"../validator.js\").Definitions} defs\n * @return {boolean}\n */\nexport function dictionaryIncludesRequiredField(dict, defs) {\n if (defs.cache.dictionaryIncludesRequiredField.has(dict)) {\n return defs.cache.dictionaryIncludesRequiredField.get(dict);\n }\n // Set cached result to indeterminate to short-circuit circular definitions.\n // The final result will be updated to true or false.\n defs.cache.dictionaryIncludesRequiredField.set(dict, undefined);\n let result = dict.members.some((field) => field.required);\n if (!result && dict.inheritance) {\n const superdict = defs.unique.get(dict.inheritance);\n if (!superdict) {\n // Assume required members in the supertype if it is unknown.\n result = true;\n } else if (dictionaryIncludesRequiredField(superdict, defs)) {\n result = true;\n }\n }\n defs.cache.dictionaryIncludesRequiredField.set(dict, result);\n return result;\n}\n","export class ArrayBase extends Array {\n constructor({ source, tokens }) {\n super();\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens },\n parent: { value: null, writable: true },\n });\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class WrappedToken extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\n static parser(tokeniser, type) {\n return () => {\n const value = tokeniser.consumeKind(type);\n if (value) {\n return new WrappedToken({\n source: tokeniser.source,\n tokens: { value },\n });\n }\n };\n }\n\n get value() {\n return unescape(this.tokens.value.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.value),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Eof extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"eof\");\n if (value) {\n return new Eof({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"eof\";\n }\n}\n","import { Base } from \"./base.js\";\nimport { ArrayBase } from \"./array-base.js\";\nimport { WrappedToken } from \"./token.js\";\nimport { list, argument_list, autoParenter, unescape } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} tokenName\n */\nfunction tokens(tokeniser, tokenName) {\n return list(tokeniser, {\n parser: WrappedToken.parser(tokeniser, tokenName),\n listName: tokenName + \" list\",\n });\n}\n\nconst extAttrValueSyntax = [\"identifier\", \"decimal\", \"integer\", \"string\"];\n\nconst shouldBeLegacyPrefixed = [\n \"NoInterfaceObject\",\n \"LenientSetter\",\n \"LenientThis\",\n \"TreatNonObjectAsNull\",\n \"Unforgeable\",\n];\n\nconst renamedLegacies = new Map([\n .../** @type {[string, string][]} */ (\n shouldBeLegacyPrefixed.map((name) => [name, `Legacy${name}`])\n ),\n [\"NamedConstructor\", \"LegacyFactoryFunction\"],\n [\"OverrideBuiltins\", \"LegacyOverrideBuiltIns\"],\n [\"TreatNullAs\", \"LegacyNullToEmptyString\"],\n]);\n\n/**\n * This will allow a set of extended attribute values to be parsed.\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction extAttrListItems(tokeniser) {\n for (const syntax of extAttrValueSyntax) {\n const toks = tokens(tokeniser, syntax);\n if (toks.length) {\n return toks;\n }\n }\n tokeniser.error(\n `Expected identifiers, strings, decimals, or integers but none found`\n );\n}\n\nexport class ExtendedAttributeParameters extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = { assign: tokeniser.consume(\"=\") };\n const ret = autoParenter(\n new ExtendedAttributeParameters({ source: tokeniser.source, tokens })\n );\n ret.list = [];\n if (tokens.assign) {\n tokens.asterisk = tokeniser.consume(\"*\");\n if (tokens.asterisk) {\n return ret.this;\n }\n tokens.secondaryName = tokeniser.consumeKind(...extAttrValueSyntax);\n }\n tokens.open = tokeniser.consume(\"(\");\n if (tokens.open) {\n ret.list = ret.rhsIsList\n ? // [Exposed=(Window,Worker)]\n extAttrListItems(tokeniser)\n : // [LegacyFactoryFunction=Audio(DOMString src)] or [Constructor(DOMString str)]\n argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unexpected token in extended attribute argument list\");\n } else if (tokens.assign && !tokens.secondaryName) {\n tokeniser.error(\"No right hand side to extended attribute assignment\");\n }\n return ret.this;\n }\n\n get rhsIsList() {\n return (\n this.tokens.assign && !this.tokens.asterisk && !this.tokens.secondaryName\n );\n }\n\n get rhsType() {\n if (this.rhsIsList) {\n return this.list[0].tokens.value.type + \"-list\";\n }\n if (this.tokens.asterisk) {\n return \"*\";\n }\n if (this.tokens.secondaryName) {\n return this.tokens.secondaryName.type;\n }\n return null;\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { rhsType } = this;\n return w.ts.wrap([\n w.token(this.tokens.assign),\n w.token(this.tokens.asterisk),\n w.reference_token(this.tokens.secondaryName, this.parent),\n w.token(this.tokens.open),\n ...this.list.map((p) => {\n return rhsType === \"identifier-list\"\n ? w.identifier(p, this.parent)\n : p.write(w);\n }),\n w.token(this.tokens.close),\n ]);\n }\n}\n\nexport class SimpleExtendedAttribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consumeKind(\"identifier\");\n if (name) {\n return new SimpleExtendedAttribute({\n source: tokeniser.source,\n tokens: { name },\n params: ExtendedAttributeParameters.parse(tokeniser),\n });\n }\n }\n\n constructor({ source, tokens, params }) {\n super({ source, tokens });\n params.parent = this;\n Object.defineProperty(this, \"params\", { value: params });\n }\n\n get type() {\n return \"extended-attribute\";\n }\n get name() {\n return this.tokens.name.value;\n }\n get rhs() {\n const { rhsType: type, tokens, list } = this.params;\n if (!type) {\n return null;\n }\n const value = this.params.rhsIsList\n ? list\n : this.params.tokens.secondaryName\n ? unescape(tokens.secondaryName.value)\n : null;\n return { type, value };\n }\n get arguments() {\n const { rhsIsList, list } = this.params;\n if (!list || rhsIsList) {\n return [];\n }\n return list;\n }\n\n *validate(defs) {\n const { name } = this;\n if (name === \"LegacyNoInterfaceObject\") {\n const message = `\\`[LegacyNoInterfaceObject]\\` extended attribute is an \\\nundesirable feature that may be removed from Web IDL in the future. Refer to the \\\n[relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more \\\ninformation.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nointerfaceobject\",\n message,\n { level: \"warning\" }\n );\n } else if (renamedLegacies.has(name)) {\n const message = `\\`[${name}]\\` extended attribute is a legacy feature \\\nthat is now renamed to \\`[${renamedLegacies.get(name)}]\\`. Refer to the \\\n[relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more \\\ninformation.`;\n yield validationError(this.tokens.name, this, \"renamed-legacy\", message, {\n level: \"warning\",\n autofix: renameLegacyExtendedAttribute(this),\n });\n }\n for (const arg of this.arguments) {\n yield* arg.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.ts.trivia(this.tokens.name.trivia),\n w.ts.extendedAttribute(\n w.ts.wrap([\n w.ts.extendedAttributeReference(this.name),\n this.params.write(w),\n ])\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {SimpleExtendedAttribute} extAttr\n */\nfunction renameLegacyExtendedAttribute(extAttr) {\n return () => {\n const { name } = extAttr;\n extAttr.tokens.name.value = renamedLegacies.get(name);\n if (name === \"TreatNullAs\") {\n extAttr.params.tokens = {};\n }\n };\n}\n\n// Note: we parse something simpler than the official syntax. It's all that ever\n// seems to be used\nexport class ExtendedAttributes extends ArrayBase {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"[\");\n const ret = new ExtendedAttributes({ source: tokeniser.source, tokens });\n if (!tokens.open) return ret;\n ret.push(\n ...list(tokeniser, {\n parser: SimpleExtendedAttribute.parse,\n listName: \"extended attribute\",\n })\n );\n tokens.close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\n \"Expected a closing token for the extended attribute list\"\n );\n if (!ret.length) {\n tokeniser.unconsume(tokens.close.index);\n tokeniser.error(\"An extended attribute list must not be empty\");\n }\n if (tokeniser.probe(\"[\")) {\n tokeniser.error(\n \"Illegal double extended attribute lists, consider merging them\"\n );\n }\n return ret;\n }\n\n *validate(defs) {\n for (const extAttr of this) {\n yield* extAttr.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n if (!this.length) return \"\";\n return w.ts.wrap([\n w.token(this.tokens.open),\n ...this.map((ea) => ea.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n return_type,\n primitive_type,\n autoParenter,\n} from \"./helpers.js\";\nimport { stringTypes, typeNameKeywords } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction generic_type(tokeniser, typeName) {\n const base = tokeniser.consume(\n \"FrozenArray\",\n \"ObservableArray\",\n \"Promise\",\n \"sequence\",\n \"record\"\n );\n if (!base) {\n return;\n }\n const ret = autoParenter(\n new Type({ source: tokeniser.source, tokens: { base } })\n );\n ret.tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`No opening bracket after ${base.value}`);\n switch (base.value) {\n case \"Promise\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Promise type cannot have extended attribute\");\n const subtype =\n return_type(tokeniser, typeName) ||\n tokeniser.error(\"Missing Promise subtype\");\n ret.subtype.push(subtype);\n break;\n }\n case \"sequence\":\n case \"FrozenArray\":\n case \"ObservableArray\": {\n const subtype =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(`Missing ${base.value} subtype`);\n ret.subtype.push(subtype);\n break;\n }\n case \"record\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Record key cannot have extended attribute\");\n const keyType =\n tokeniser.consume(...stringTypes) ||\n tokeniser.error(`Record key must be one of: ${stringTypes.join(\", \")}`);\n const keyIdlType = new Type({\n source: tokeniser.source,\n tokens: { base: keyType },\n });\n keyIdlType.tokens.separator =\n tokeniser.consume(\",\") ||\n tokeniser.error(\"Missing comma after record key type\");\n keyIdlType.type = typeName;\n const valueType =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(\"Error parsing generic type record\");\n ret.subtype.push(keyIdlType, valueType);\n break;\n }\n }\n if (!ret.idlType) tokeniser.error(`Error parsing generic type ${base.value}`);\n ret.tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing closing bracket after ${base.value}`);\n return ret.this;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction type_suffix(tokeniser, obj) {\n const nullable = tokeniser.consume(\"?\");\n if (nullable) {\n obj.tokens.nullable = nullable;\n }\n if (tokeniser.probe(\"?\")) tokeniser.error(\"Can't nullable more than once\");\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction single_type(tokeniser, typeName) {\n let ret = generic_type(tokeniser, typeName) || primitive_type(tokeniser);\n if (!ret) {\n const base =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(...stringTypes, ...typeNameKeywords);\n if (!base) {\n return;\n }\n ret = new Type({ source: tokeniser.source, tokens: { base } });\n if (tokeniser.probe(\"<\"))\n tokeniser.error(`Unsupported generic type ${base.value}`);\n }\n if (ret.generic === \"Promise\" && tokeniser.probe(\"?\")) {\n tokeniser.error(\"Promise type cannot be nullable\");\n }\n ret.type = typeName || null;\n type_suffix(tokeniser, ret);\n if (ret.nullable && ret.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be made nullable\");\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\nfunction union_type(tokeniser, type) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"(\");\n if (!tokens.open) return;\n const ret = autoParenter(new Type({ source: tokeniser.source, tokens }));\n ret.type = type || null;\n while (true) {\n const typ =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(\"No type after open parenthesis or 'or' in union type\");\n if (typ.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be included in a union type\");\n if (typ.generic === \"Promise\")\n tokeniser.error(\"Type `Promise` cannot be included in a union type\");\n ret.subtype.push(typ);\n const or = tokeniser.consume(\"or\");\n if (or) {\n typ.tokens.separator = or;\n } else break;\n }\n if (ret.idlType.length < 2) {\n tokeniser.error(\n \"At least two types are expected in a union type but found less\"\n );\n }\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated union type\");\n type_suffix(tokeniser, ret);\n return ret.this;\n}\n\nexport class Type extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\n static parse(tokeniser, typeName) {\n return single_type(tokeniser, typeName) || union_type(tokeniser, typeName);\n }\n\n constructor({ source, tokens }) {\n super({ source, tokens });\n Object.defineProperty(this, \"subtype\", { value: [], writable: true });\n this.extAttrs = new ExtendedAttributes({ source, tokens: {} });\n }\n\n get generic() {\n if (this.subtype.length && this.tokens.base) {\n return this.tokens.base.value;\n }\n return \"\";\n }\n get nullable() {\n return Boolean(this.tokens.nullable);\n }\n get union() {\n return Boolean(this.subtype.length) && !this.tokens.base;\n }\n get idlType() {\n if (this.subtype.length) {\n return this.subtype;\n }\n // Adding prefixes/postfixes for \"unrestricted float\", etc.\n const name = [this.tokens.prefix, this.tokens.base, this.tokens.postfix]\n .filter((t) => t)\n .map((t) => t.value)\n .join(\" \");\n return unescape(name);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n\n if (this.idlType === \"void\") {\n const message = `\\`void\\` is now replaced by \\`undefined\\`. Refer to the \\\n[relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) \\\nfor more information.`;\n yield validationError(this.tokens.base, this, \"replace-void\", message, {\n autofix: replaceVoid(this),\n });\n }\n\n /*\n * If a union is nullable, its subunions cannot include a dictionary\n * If not, subunions may include dictionaries if each union is not nullable\n */\n const typedef = !this.union && defs.unique.get(this.idlType);\n const target = this.union\n ? this\n : typedef && typedef.type === \"typedef\"\n ? typedef.idlType\n : undefined;\n if (target && this.nullable) {\n // do not allow any dictionary\n const { reference } = idlTypeIncludesDictionary(target, defs) || {};\n if (reference) {\n const targetToken = (this.union ? reference : this).tokens.base;\n const message = \"Nullable union cannot include a dictionary type.\";\n yield validationError(\n targetToken,\n this,\n \"no-nullable-union-dict\",\n message\n );\n }\n } else {\n // allow some dictionary\n for (const subtype of this.subtype) {\n yield* subtype.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const type_body = () => {\n if (this.union || this.generic) {\n return w.ts.wrap([\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n ...this.subtype.map((t) => t.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n const firstToken = this.tokens.prefix || this.tokens.base;\n const prefix = this.tokens.prefix\n ? [this.tokens.prefix.value, w.ts.trivia(this.tokens.base.trivia)]\n : [];\n const ref = w.reference(\n w.ts.wrap([\n ...prefix,\n this.tokens.base.value,\n w.token(this.tokens.postfix),\n ]),\n {\n unescaped: /** @type {string} (because it's not union) */ (\n this.idlType\n ),\n context: this,\n }\n );\n return w.ts.wrap([w.ts.trivia(firstToken.trivia), ref]);\n };\n return w.ts.wrap([\n this.extAttrs.write(w),\n type_body(),\n w.token(this.tokens.nullable),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Type} type\n */\nfunction replaceVoid(type) {\n return () => {\n type.tokens.base.value = \"undefined\";\n };\n}\n","import { Base } from \"./base.js\";\nimport { const_data, const_value } from \"./helpers.js\";\n\nexport class Default extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const assign = tokeniser.consume(\"=\");\n if (!assign) {\n return null;\n }\n const def =\n const_value(tokeniser) ||\n tokeniser.consumeKind(\"string\") ||\n tokeniser.consume(\"null\", \"[\", \"{\") ||\n tokeniser.error(\"No value for default\");\n const expression = [def];\n if (def.value === \"[\") {\n const close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\"Default sequence value must be empty\");\n expression.push(close);\n } else if (def.value === \"{\") {\n const close =\n tokeniser.consume(\"}\") ||\n tokeniser.error(\"Default dictionary value must be empty\");\n expression.push(close);\n }\n return new Default({\n source: tokeniser.source,\n tokens: { assign },\n expression,\n });\n }\n\n constructor({ source, tokens, expression }) {\n super({ source, tokens });\n expression.parent = this;\n Object.defineProperty(this, \"expression\", { value: expression });\n }\n\n get type() {\n return const_data(this.expression[0]).type;\n }\n get value() {\n return const_data(this.expression[0]).value;\n }\n get negative() {\n return const_data(this.expression[0]).negative;\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.assign),\n ...this.expression.map((t) => w.token(t)),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport { Default } from \"./default.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n getFirstToken,\n} from \"./helpers.js\";\nimport { argumentNameKeywords, Tokeniser } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport {\n idlTypeIncludesDictionary,\n dictionaryIncludesRequiredField,\n} from \"../validators/helpers.js\";\n\nexport class Argument extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(\n new Argument({ source: tokeniser.source, tokens })\n );\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.optional = tokeniser.consume(\"optional\");\n ret.idlType = type_with_extended_attributes(tokeniser, \"argument-type\");\n if (!ret.idlType) {\n return tokeniser.unconsume(start_position);\n }\n if (!tokens.optional) {\n tokens.variadic = tokeniser.consume(\"...\");\n }\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(...argumentNameKeywords);\n if (!tokens.name) {\n return tokeniser.unconsume(start_position);\n }\n ret.default = tokens.optional ? Default.parse(tokeniser) : null;\n return ret.this;\n }\n\n get type() {\n return \"argument\";\n }\n get optional() {\n return !!this.tokens.optional;\n }\n get variadic() {\n return !!this.tokens.variadic;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /**\n * @param {import(\"../validator.js\").Definitions} defs\n */\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n const result = idlTypeIncludesDictionary(this.idlType, defs, {\n useNullableInner: true,\n });\n if (result) {\n if (this.idlType.nullable) {\n const message = `Dictionary arguments cannot be nullable.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nullable-dict-arg\",\n message\n );\n } else if (!this.optional) {\n if (\n this.parent &&\n !dictionaryIncludesRequiredField(result.dictionary, defs) &&\n isLastRequiredArgument(this)\n ) {\n const message = `Dictionary argument must be optional if it has no required fields`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-optional\",\n message,\n {\n autofix: autofixDictionaryArgumentOptionality(this),\n }\n );\n }\n } else if (!this.default) {\n const message = `Optional dictionary arguments must have a default value of \\`{}\\`.`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-default\",\n message,\n {\n autofix: autofixOptionalDictionaryDefaultValue(this),\n }\n );\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.optional),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.variadic),\n w.name_token(this.tokens.name, { data: this }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Argument} arg\n */\nfunction isLastRequiredArgument(arg) {\n const list = arg.parent.arguments || arg.parent.list;\n const index = list.indexOf(arg);\n const requiredExists = list.slice(index + 1).some((a) => !a.optional);\n return !requiredExists;\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixDictionaryArgumentOptionality(arg) {\n return () => {\n const firstToken = getFirstToken(arg.idlType);\n arg.tokens.optional = {\n ...firstToken,\n type: \"optional\",\n value: \"optional\",\n };\n firstToken.trivia = \" \";\n autofixOptionalDictionaryDefaultValue(arg)();\n };\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixOptionalDictionaryDefaultValue(arg) {\n return () => {\n arg.default = Default.parse(new Tokeniser(\" = {}\"));\n };\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\nexport class Operation extends Base {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {Token} [options.special]\n * @param {Token} [options.regular]\n */\n static parse(tokeniser, { special, regular } = {}) {\n const tokens = { special };\n const ret = autoParenter(\n new Operation({ source: tokeniser.source, tokens })\n );\n if (special && special.value === \"stringifier\") {\n tokens.termination = tokeniser.consume(\";\");\n if (tokens.termination) {\n ret.arguments = [];\n return ret;\n }\n }\n if (!special && !regular) {\n tokens.special = tokeniser.consume(\"getter\", \"setter\", \"deleter\");\n }\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Missing return type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") || tokeniser.consume(\"includes\");\n tokens.open =\n tokeniser.consume(\"(\") || tokeniser.error(\"Invalid operation\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated operation\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated operation, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"operation\";\n }\n get name() {\n const { name } = this.tokens;\n if (!name) {\n return \"\";\n }\n return unescape(name.value);\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (!this.name && [\"\", \"static\"].includes(this.special)) {\n const message = `Regular or static operations must have both a return type and an identifier.`;\n yield validationError(this.tokens.open, this, \"incomplete-op\", message);\n }\n if (this.idlType) {\n yield* this.idlType.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n const body = this.idlType\n ? [\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n ]\n : [];\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n this.tokens.name\n ? w.token(this.tokens.special)\n : w.token(this.tokens.special, w.ts.nameless, { data: this, parent }),\n ...body,\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Attribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.special]\n * @param {boolean} [options.noInherit]\n * @param {boolean} [options.readonly]\n */\n static parse(\n tokeniser,\n { special, noInherit = false, readonly = false } = {}\n ) {\n const start_position = tokeniser.position;\n const tokens = { special };\n const ret = autoParenter(\n new Attribute({ source: tokeniser.source, tokens })\n );\n if (!special && !noInherit) {\n tokens.special = tokeniser.consume(\"inherit\");\n }\n if (ret.special === \"inherit\" && tokeniser.probe(\"readonly\")) {\n tokeniser.error(\"Inherited attributes cannot be read-only\");\n }\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (readonly && !tokens.readonly && tokeniser.probe(\"attribute\")) {\n tokeniser.error(\"Attributes must be readonly in this context\");\n }\n tokens.base = tokeniser.consume(\"attribute\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"attribute-type\") ||\n tokeniser.error(\"Attribute lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(\"async\", \"required\") ||\n tokeniser.error(\"Attribute lacks a name\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated attribute, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"attribute\";\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n\n switch (this.idlType.generic) {\n case \"sequence\":\n case \"record\": {\n const message = `Attributes cannot accept ${this.idlType.generic} types.`;\n yield validationError(\n this.tokens.name,\n this,\n \"attr-invalid-type\",\n message\n );\n break;\n }\n default: {\n const { reference } =\n idlTypeIncludesDictionary(this.idlType, defs) || {};\n if (reference) {\n const targetToken = (this.idlType.union ? reference : this.idlType)\n .tokens.base;\n const message = \"Attributes cannot accept dictionary types.\";\n yield validationError(\n targetToken,\n this,\n \"attr-invalid-type\",\n message\n );\n }\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.special),\n w.token(this.tokens.readonly),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Type } from \"./type.js\";\nimport { Argument } from \"./argument.js\";\nimport {\n ExtendedAttributes,\n SimpleExtendedAttribute,\n} from \"./extended-attributes.js\";\nimport { Operation } from \"./operation.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\n\n/**\n * @param {string} identifier\n */\nexport function unescape(identifier) {\n return identifier.startsWith(\"_\") ? identifier.slice(1) : identifier;\n}\n\n/**\n * Parses comma-separated list\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} args\n * @param {Function} args.parser parser function for each item\n * @param {boolean} [args.allowDangler] whether to allow dangling comma\n * @param {string} [args.listName] the name to be shown on error messages\n */\nexport function list(tokeniser, { parser, allowDangler, listName = \"list\" }) {\n const first = parser(tokeniser);\n if (!first) {\n return [];\n }\n first.tokens.separator = tokeniser.consume(\",\");\n const items = [first];\n while (first.tokens.separator) {\n const item = parser(tokeniser);\n if (!item) {\n if (!allowDangler) {\n tokeniser.error(`Trailing comma in ${listName}`);\n }\n break;\n }\n item.tokens.separator = tokeniser.consume(\",\");\n items.push(item);\n if (!item.tokens.separator) break;\n }\n return items;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function const_value(tokeniser) {\n return (\n tokeniser.consumeKind(\"decimal\", \"integer\") ||\n tokeniser.consume(\"true\", \"false\", \"Infinity\", \"-Infinity\", \"NaN\")\n );\n}\n\n/**\n * @param {object} token\n * @param {string} token.type\n * @param {string} token.value\n */\nexport function const_data({ type, value }) {\n switch (type) {\n case \"decimal\":\n case \"integer\":\n return { type: \"number\", value };\n case \"string\":\n return { type: \"string\", value: value.slice(1, -1) };\n }\n\n switch (value) {\n case \"true\":\n case \"false\":\n return { type: \"boolean\", value: value === \"true\" };\n case \"Infinity\":\n case \"-Infinity\":\n return { type: \"Infinity\", negative: value.startsWith(\"-\") };\n case \"[\":\n return { type: \"sequence\", value: [] };\n case \"{\":\n return { type: \"dictionary\" };\n default:\n return { type: value };\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function primitive_type(tokeniser) {\n function integer_type() {\n const prefix = tokeniser.consume(\"unsigned\");\n const base = tokeniser.consume(\"short\", \"long\");\n if (base) {\n const postfix = tokeniser.consume(\"long\");\n return new Type({ source, tokens: { prefix, base, postfix } });\n }\n if (prefix) tokeniser.error(\"Failed to parse integer type\");\n }\n\n function decimal_type() {\n const prefix = tokeniser.consume(\"unrestricted\");\n const base = tokeniser.consume(\"float\", \"double\");\n if (base) {\n return new Type({ source, tokens: { prefix, base } });\n }\n if (prefix) tokeniser.error(\"Failed to parse float type\");\n }\n\n const { source } = tokeniser;\n const num_type = integer_type() || decimal_type();\n if (num_type) return num_type;\n const base = tokeniser.consume(\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"octet\",\n \"undefined\"\n );\n if (base) {\n return new Type({ source, tokens: { base } });\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function argument_list(tokeniser) {\n return list(tokeniser, {\n parser: Argument.parse,\n listName: \"arguments list\",\n });\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\n */\nexport function type_with_extended_attributes(tokeniser, typeName) {\n const extAttrs = ExtendedAttributes.parse(tokeniser);\n const ret = Type.parse(tokeniser, typeName);\n if (ret) autoParenter(ret).extAttrs = extAttrs;\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\n */\nexport function return_type(tokeniser, typeName) {\n const typ = Type.parse(tokeniser, typeName || \"return-type\");\n if (typ) {\n return typ;\n }\n const voidToken = tokeniser.consume(\"void\");\n if (voidToken) {\n const ret = new Type({\n source: tokeniser.source,\n tokens: { base: voidToken },\n });\n ret.type = \"return-type\";\n return ret;\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function stringifier(tokeniser) {\n const special = tokeniser.consume(\"stringifier\");\n if (!special) return;\n const member =\n Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"Unterminated stringifier\");\n return member;\n}\n\n/**\n * @param {string} str\n */\nexport function getLastIndentation(str) {\n const lines = str.split(\"\\n\");\n // the first line visually binds to the preceding token\n if (lines.length) {\n const match = lines[lines.length - 1].match(/^\\s+/);\n if (match) {\n return match[0];\n }\n }\n return \"\";\n}\n\n/**\n * @param {string} parentTrivia\n */\nexport function getMemberIndentation(parentTrivia) {\n const indentation = getLastIndentation(parentTrivia);\n const indentCh = indentation.includes(\"\\t\") ? \"\\t\" : \" \";\n return indentation + indentCh;\n}\n\n/**\n * @param {import(\"./interface.js\").Interface} def\n */\nexport function autofixAddExposedWindow(def) {\n return () => {\n if (def.extAttrs.length) {\n const tokeniser = new Tokeniser(\"Exposed=Window,\");\n const exposed = SimpleExtendedAttribute.parse(tokeniser);\n exposed.tokens.separator = tokeniser.consume(\",\");\n const existing = def.extAttrs[0];\n if (!/^\\s/.test(existing.tokens.name.trivia)) {\n existing.tokens.name.trivia = ` ${existing.tokens.name.trivia}`;\n }\n def.extAttrs.unshift(exposed);\n } else {\n autoParenter(def).extAttrs = ExtendedAttributes.parse(\n new Tokeniser(\"[Exposed=Window]\")\n );\n const trivia = def.tokens.base.trivia;\n def.extAttrs.tokens.open.trivia = trivia;\n def.tokens.base.trivia = `\\n${getLastIndentation(trivia)}`;\n }\n };\n}\n\n/**\n * Get the first syntax token for the given IDL object.\n * @param {*} data\n */\nexport function getFirstToken(data) {\n if (data.extAttrs.length) {\n return data.extAttrs.tokens.open;\n }\n if (data.type === \"operation\" && !data.special) {\n return getFirstToken(data.idlType);\n }\n const tokens = Object.values(data.tokens).sort((x, y) => x.index - y.index);\n return tokens[0];\n}\n\n/**\n * @template T\n * @param {T[]} array\n * @param {(item: T) => boolean} predicate\n */\nexport function findLastIndex(array, predicate) {\n const index = array.slice().reverse().findIndex(predicate);\n if (index === -1) {\n return index;\n }\n return array.length - index - 1;\n}\n\n/**\n * Returns a proxy that auto-assign `parent` field.\n * @template {Record<string | symbol, any>} T\n * @param {T} data\n * @param {*} [parent] The object that will be assigned to `parent`.\n * If absent, it will be `data` by default.\n * @return {T}\n */\nexport function autoParenter(data, parent) {\n if (!parent) {\n // Defaults to `data` unless specified otherwise.\n parent = data;\n }\n if (!data) {\n // This allows `autoParenter(undefined)` which again allows\n // `autoParenter(parse())` where the function may return nothing.\n return data;\n }\n const proxy = new Proxy(data, {\n get(target, p) {\n const value = target[p];\n if (Array.isArray(value) && p !== \"source\") {\n // Wraps the array so that any added items will also automatically\n // get their `parent` values.\n return autoParenter(value, target);\n }\n return value;\n },\n set(target, p, value) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/47357\n target[p] = value;\n if (!value) {\n return true;\n } else if (Array.isArray(value)) {\n // Assigning an array will add `parent` to its items.\n for (const item of value) {\n if (typeof item.parent !== \"undefined\") {\n item.parent = parent;\n }\n }\n } else if (typeof value.parent !== \"undefined\") {\n value.parent = parent;\n }\n return true;\n },\n });\n return proxy;\n}\n","import { syntaxError } from \"./error.js\";\nimport { unescape } from \"./productions/helpers.js\";\n\n// These regular expressions use the sticky flag so they will only match at\n// the current location (ie. the offset of lastIndex).\nconst tokenRe = {\n // This expression uses a lookahead assertion to catch false matches\n // against integers early.\n decimal:\n /-?(?=[0-9]*\\.|[0-9]+[eE])(([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,\n integer: /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,\n identifier: /[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,\n string: /\"[^\"]*\"/y,\n whitespace: /[\\t\\n\\r ]+/y,\n comment: /\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\//y,\n other: /[^\\t\\n\\r 0-9A-Za-z]/y,\n};\n\nexport const typeNameKeywords = [\n \"ArrayBuffer\",\n \"DataView\",\n \"Int8Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Uint8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8ClampedArray\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"any\",\n \"object\",\n \"symbol\",\n];\n\nexport const stringTypes = [\"ByteString\", \"DOMString\", \"USVString\"];\n\nexport const argumentNameKeywords = [\n \"async\",\n \"attribute\",\n \"callback\",\n \"const\",\n \"constructor\",\n \"deleter\",\n \"dictionary\",\n \"enum\",\n \"getter\",\n \"includes\",\n \"inherit\",\n \"interface\",\n \"iterable\",\n \"maplike\",\n \"namespace\",\n \"partial\",\n \"required\",\n \"setlike\",\n \"setter\",\n \"static\",\n \"stringifier\",\n \"typedef\",\n \"unrestricted\",\n];\n\nconst nonRegexTerminals = [\n \"-Infinity\",\n \"FrozenArray\",\n \"Infinity\",\n \"NaN\",\n \"ObservableArray\",\n \"Promise\",\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"double\",\n \"false\",\n \"float\",\n \"long\",\n \"mixin\",\n \"null\",\n \"octet\",\n \"optional\",\n \"or\",\n \"readonly\",\n \"record\",\n \"sequence\",\n \"short\",\n \"true\",\n \"undefined\",\n \"unsigned\",\n \"void\",\n].concat(argumentNameKeywords, stringTypes, typeNameKeywords);\n\nconst punctuations = [\n \"(\",\n \")\",\n \",\",\n \"...\",\n \":\",\n \";\",\n \"<\",\n \"=\",\n \">\",\n \"?\",\n \"*\",\n \"[\",\n \"]\",\n \"{\",\n \"}\",\n];\n\nconst reserved = [\n // \"constructor\" is now a keyword\n \"_constructor\",\n \"toString\",\n \"_toString\",\n];\n\n/**\n * @typedef {ArrayItemType<ReturnType<typeof tokenise>>} Token\n * @param {string} str\n */\nfunction tokenise(str) {\n const tokens = [];\n let lastCharIndex = 0;\n let trivia = \"\";\n let line = 1;\n let index = 0;\n while (lastCharIndex < str.length) {\n const nextChar = str.charAt(lastCharIndex);\n let result = -1;\n\n if (/[\\t\\n\\r ]/.test(nextChar)) {\n result = attemptTokenMatch(\"whitespace\", { noFlushTrivia: true });\n } else if (nextChar === \"/\") {\n result = attemptTokenMatch(\"comment\", { noFlushTrivia: true });\n }\n\n if (result !== -1) {\n const currentTrivia = tokens.pop().value;\n line += (currentTrivia.match(/\\n/g) || []).length;\n trivia += currentTrivia;\n index -= 1;\n } else if (/[-0-9.A-Z_a-z]/.test(nextChar)) {\n result = attemptTokenMatch(\"decimal\");\n if (result === -1) {\n result = attemptTokenMatch(\"integer\");\n }\n if (result === -1) {\n result = attemptTokenMatch(\"identifier\");\n const lastIndex = tokens.length - 1;\n const token = tokens[lastIndex];\n if (result !== -1) {\n if (reserved.includes(token.value)) {\n const message = `${unescape(\n token.value\n )} is a reserved identifier and must not be used.`;\n throw new WebIDLParseError(\n syntaxError(tokens, lastIndex, null, message)\n );\n } else if (nonRegexTerminals.includes(token.value)) {\n token.type = \"inline\";\n }\n }\n }\n } else if (nextChar === '\"') {\n result = attemptTokenMatch(\"string\");\n }\n\n for (const punctuation of punctuations) {\n if (str.startsWith(punctuation, lastCharIndex)) {\n tokens.push({\n type: \"inline\",\n value: punctuation,\n trivia,\n line,\n index,\n });\n trivia = \"\";\n lastCharIndex += punctuation.length;\n result = lastCharIndex;\n break;\n }\n }\n\n // other as the last try\n if (result === -1) {\n result = attemptTokenMatch(\"other\");\n }\n if (result === -1) {\n throw new Error(\"Token stream not progressing\");\n }\n lastCharIndex = result;\n index += 1;\n }\n\n // remaining trivia as eof\n tokens.push({\n type: \"eof\",\n value: \"\",\n trivia,\n line,\n index,\n });\n\n return tokens;\n\n /**\n * @param {keyof typeof tokenRe} type\n * @param {object} options\n * @param {boolean} [options.noFlushTrivia]\n */\n function attemptTokenMatch(type, { noFlushTrivia } = {}) {\n const re = tokenRe[type];\n re.lastIndex = lastCharIndex;\n const result = re.exec(str);\n if (result) {\n tokens.push({ type, value: result[0], trivia, line, index });\n if (!noFlushTrivia) {\n trivia = \"\";\n }\n return re.lastIndex;\n }\n return -1;\n }\n}\n\nexport class Tokeniser {\n /**\n * @param {string} idl\n */\n constructor(idl) {\n this.source = tokenise(idl);\n this.position = 0;\n }\n\n /**\n * @param {string} message\n * @return {never}\n */\n error(message) {\n throw new WebIDLParseError(\n syntaxError(this.source, this.position, this.current, message)\n );\n }\n\n /**\n * @param {string} type\n */\n probeKind(type) {\n return (\n this.source.length > this.position &&\n this.source[this.position].type === type\n );\n }\n\n /**\n * @param {string} value\n */\n probe(value) {\n return (\n this.probeKind(\"inline\") && this.source[this.position].value === value\n );\n }\n\n /**\n * @param {...string} candidates\n */\n consumeKind(...candidates) {\n for (const type of candidates) {\n if (!this.probeKind(type)) continue;\n const token = this.source[this.position];\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {...string} candidates\n */\n consume(...candidates) {\n if (!this.probeKind(\"inline\")) return;\n const token = this.source[this.position];\n for (const value of candidates) {\n if (token.value !== value) continue;\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {string} value\n */\n consumeIdentifier(value) {\n if (!this.probeKind(\"identifier\")) {\n return;\n }\n if (this.source[this.position].value !== value) {\n return;\n }\n return this.consumeKind(\"identifier\");\n }\n\n /**\n * @param {number} position\n */\n unconsume(position) {\n this.position = position;\n }\n}\n\nexport class WebIDLParseError extends Error {\n /**\n * @param {object} options\n * @param {string} options.message\n * @param {string} options.bareMessage\n * @param {string} options.context\n * @param {number} options.line\n * @param {*} options.sourceName\n * @param {string} options.input\n * @param {*[]} options.tokens\n */\n constructor({\n message,\n bareMessage,\n context,\n line,\n sourceName,\n input,\n tokens,\n }) {\n super(message);\n\n this.name = \"WebIDLParseError\"; // not to be mangled\n this.bareMessage = bareMessage;\n this.context = context;\n this.line = line;\n this.sourceName = sourceName;\n this.input = input;\n this.tokens = tokens;\n }\n}\n","import { list, unescape, autoParenter } from \"./helpers.js\";\nimport { WrappedToken } from \"./token.js\";\nimport { Base } from \"./base.js\";\n\nexport class EnumValue extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"string\");\n if (value) {\n return new EnumValue({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"enum-value\";\n }\n get value() {\n return super.value.slice(1, -1);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.wrap([\n w.ts.trivia(this.tokens.value.trivia),\n w.ts.definition(\n w.ts.wrap(['\"', w.ts.name(this.value, { data: this, parent }), '\"']),\n { data: this, parent }\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Enum extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"enum\");\n if (!tokens.base) {\n return;\n }\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"No name for enum\");\n const ret = autoParenter(new Enum({ source: tokeniser.source, tokens }));\n tokeniser.current = ret.this;\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(\"Bodyless enum\");\n ret.values = list(tokeniser, {\n parser: EnumValue.parse,\n allowDangler: true,\n listName: \"enumeration\",\n });\n if (tokeniser.probeKind(\"string\")) {\n tokeniser.error(\"No comma between enum values\");\n }\n tokens.close =\n tokeniser.consume(\"}\") || tokeniser.error(\"Unexpected value in enum\");\n if (!ret.values.length) {\n tokeniser.error(\"No value in enum\");\n }\n tokens.termination =\n tokeniser.consume(\";\") || tokeniser.error(\"No semicolon after enum\");\n return ret.this;\n }\n\n get type() {\n return \"enum\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.open),\n w.ts.wrap(this.values.map((v) => v.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Includes extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const target = tokeniser.consumeKind(\"identifier\");\n if (!target) {\n return;\n }\n const tokens = { target };\n tokens.includes = tokeniser.consume(\"includes\");\n if (!tokens.includes) {\n tokeniser.unconsume(target.index);\n return;\n }\n tokens.mixin =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Incomplete includes statement\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"No terminating ; for includes statement\");\n return new Includes({ source: tokeniser.source, tokens });\n }\n\n get type() {\n return \"includes\";\n }\n get target() {\n return unescape(this.tokens.target.value);\n }\n get includes() {\n return unescape(this.tokens.mixin.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.reference_token(this.tokens.target, this),\n w.token(this.tokens.includes),\n w.reference_token(this.tokens.mixin, this),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Typedef extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Typedef({ source: tokeniser.source, tokens }));\n tokens.base = tokeniser.consume(\"typedef\");\n if (!tokens.base) {\n return;\n }\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"typedef-type\") ||\n tokeniser.error(\"Typedef lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Typedef lacks a name\");\n tokeniser.current = ret.this;\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated typedef, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"typedef\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class CallbackFunction extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base) {\n const tokens = { base };\n const ret = autoParenter(\n new CallbackFunction({ source: tokeniser.source, tokens })\n );\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Callback lacks a name\");\n tokeniser.current = ret.this;\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Callback lacks an assignment\");\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Callback lacks a return type\");\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"Callback lacks parentheses for arguments\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated callback\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated callback, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"callback\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.assign),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.open),\n ...this.arguments.map((arg) => arg.write(w)),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { unescape, autoParenter } from \"./helpers.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction inheritance(tokeniser) {\n const colon = tokeniser.consume(\":\");\n if (!colon) {\n return {};\n }\n const inheritance =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Inheritance lacks a type\");\n return { colon, inheritance };\n}\n\nexport class Container extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {*} instance TODO: This should be {T extends Container}, but see https://github.com/microsoft/TypeScript/issues/4628\n * @param {*} args\n */\n static parse(tokeniser, instance, { inheritable, allowedMembers }) {\n const { tokens, type } = instance;\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(`Missing name in ${type}`);\n tokeniser.current = instance;\n instance = autoParenter(instance);\n if (inheritable) {\n Object.assign(tokens, inheritance(tokeniser));\n }\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(`Bodyless ${type}`);\n instance.members = [];\n while (true) {\n tokens.close = tokeniser.consume(\"}\");\n if (tokens.close) {\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(`Missing semicolon after ${type}`);\n return instance.this;\n }\n const ea = ExtendedAttributes.parse(tokeniser);\n let mem;\n for (const [parser, ...args] of allowedMembers) {\n mem = autoParenter(parser(tokeniser, ...args));\n if (mem) {\n break;\n }\n }\n if (!mem) {\n tokeniser.error(\"Unknown member\");\n }\n mem.extAttrs = ea;\n instance.members.push(mem.this);\n }\n }\n\n get partial() {\n return !!this.tokens.partial;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get inheritance() {\n if (!this.tokens.inheritance) {\n return null;\n }\n return unescape(this.tokens.inheritance.value);\n }\n\n *validate(defs) {\n for (const member of this.members) {\n if (member.validate) {\n yield* member.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const inheritance = () => {\n if (!this.tokens.inheritance) {\n return \"\";\n }\n return w.ts.wrap([\n w.token(this.tokens.colon),\n w.ts.trivia(this.tokens.inheritance.trivia),\n w.ts.inheritance(\n w.reference(this.tokens.inheritance.value, { context: this })\n ),\n ]);\n };\n\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.callback),\n w.token(this.tokens.partial),\n w.token(this.tokens.base),\n w.token(this.tokens.mixin),\n w.name_token(this.tokens.name, { data: this }),\n inheritance(),\n w.token(this.tokens.open),\n w.ts.wrap(this.members.map((m) => m.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { Type } from \"./type.js\";\nimport {\n const_data,\n const_value,\n primitive_type,\n autoParenter,\n unescape,\n} from \"./helpers.js\";\n\nexport class Constant extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"const\");\n if (!tokens.base) {\n return;\n }\n let idlType = primitive_type(tokeniser);\n if (!idlType) {\n const base =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Const lacks a type\");\n idlType = new Type({ source: tokeniser.source, tokens: { base } });\n }\n if (tokeniser.probe(\"?\")) {\n tokeniser.error(\"Unexpected nullable constant type\");\n }\n idlType.type = \"const-type\";\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Const lacks a name\");\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Const lacks value assignment\");\n tokens.value =\n const_value(tokeniser) || tokeniser.error(\"Const lacks a value\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated const, expected `;`\");\n const ret = new Constant({ source: tokeniser.source, tokens });\n autoParenter(ret).idlType = idlType;\n return ret;\n }\n\n get type() {\n return \"const\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get value() {\n return const_data(this.tokens.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.assign),\n w.token(this.tokens.value),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n autoParenter,\n argument_list,\n} from \"./helpers.js\";\n\nexport class IterableLike extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n const ret = autoParenter(\n new IterableLike({ source: tokeniser.source, tokens: {} })\n );\n const { tokens } = ret;\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (!tokens.readonly) {\n tokens.async = tokeniser.consume(\"async\");\n }\n tokens.base = tokens.readonly\n ? tokeniser.consume(\"maplike\", \"setlike\")\n : tokens.async\n ? tokeniser.consume(\"iterable\")\n : tokeniser.consume(\"iterable\", \"maplike\", \"setlike\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n\n const { type } = ret;\n const secondTypeRequired = type === \"maplike\";\n const secondTypeAllowed = secondTypeRequired || type === \"iterable\";\n const argumentAllowed = ret.async && type === \"iterable\";\n\n tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`Missing less-than sign \\`<\\` in ${type} declaration`);\n const first =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(`Missing a type argument in ${type} declaration`);\n ret.idlType = [first];\n ret.arguments = [];\n\n if (secondTypeAllowed) {\n first.tokens.separator = tokeniser.consume(\",\");\n if (first.tokens.separator) {\n ret.idlType.push(type_with_extended_attributes(tokeniser));\n } else if (secondTypeRequired) {\n tokeniser.error(`Missing second type argument in ${type} declaration`);\n }\n }\n\n tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing greater-than sign \\`>\\` in ${type} declaration`);\n\n if (tokeniser.probe(\"(\")) {\n if (argumentAllowed) {\n tokens.argsOpen = tokeniser.consume(\"(\");\n ret.arguments.push(...argument_list(tokeniser));\n tokens.argsClose =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unterminated async iterable argument list\");\n } else {\n tokeniser.error(`Arguments are only allowed for \\`async iterable\\``);\n }\n }\n\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(`Missing semicolon after ${type} declaration`);\n\n return ret.this;\n }\n\n get type() {\n return this.tokens.base.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get async() {\n return !!this.tokens.async;\n }\n\n *validate(defs) {\n for (const type of this.idlType) {\n yield* type.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.readonly),\n w.token(this.tokens.async),\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n w.ts.wrap(this.idlType.map((t) => t.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.argsOpen),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.argsClose),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent: this.parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { argument_list, autoParenter } from \"./helpers.js\";\n\nexport class Constructor extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const base = tokeniser.consume(\"constructor\");\n if (!base) {\n return;\n }\n /** @type {Base[\"tokens\"]} */\n const tokens = { base };\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"No argument list in constructor\");\n const args = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated constructor\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"No semicolon after constructor\");\n const ret = new Constructor({ source: tokeniser.source, tokens });\n autoParenter(ret).arguments = args;\n return ret;\n }\n\n get type() {\n return \"constructor\";\n }\n\n *validate(defs) {\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base, w.ts.nameless, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\nimport { IterableLike } from \"./iterable.js\";\nimport {\n stringifier,\n autofixAddExposedWindow,\n getMemberIndentation,\n getLastIndentation,\n getFirstToken,\n findLastIndex,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\nimport { checkInterfaceMemberDuplication } from \"../validators/interface.js\";\nimport { Constructor } from \"./constructor.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction static_member(tokeniser) {\n const special = tokeniser.consume(\"static\");\n if (!special) return;\n const member =\n Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"No body in static member\");\n return member;\n}\n\nexport class Interface extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base, { partial = null } = {}) {\n const tokens = { partial, base };\n return Container.parse(\n tokeniser,\n new Interface({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Constructor.parse],\n [static_member],\n [stringifier],\n [IterableLike.parse],\n [Attribute.parse],\n [Operation.parse],\n ],\n }\n );\n }\n\n get type() {\n return \"interface\";\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\n const message = `Interfaces must have \\`[Exposed]\\` extended attribute. \\\nTo fix, add, for example, \\`[Exposed=Window]\\`. Please also consider carefully \\\nif your interface should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n const oldConstructors = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"Constructor\"\n );\n for (const constructor of oldConstructors) {\n const message = `Constructors should now be represented as a \\`constructor()\\` operation on the interface \\\ninstead of \\`[Constructor]\\` extended attribute. Refer to the \\\n[WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) \\\nfor more information.`;\n yield validationError(\n constructor.tokens.name,\n this,\n \"constructor-member\",\n message,\n {\n autofix: autofixConstructor(this, constructor),\n }\n );\n }\n\n const isGlobal = this.extAttrs.some((extAttr) => extAttr.name === \"Global\");\n if (isGlobal) {\n const factoryFunctions = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"LegacyFactoryFunction\"\n );\n for (const named of factoryFunctions) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have factory functions.`;\n yield validationError(\n named.tokens.name,\n this,\n \"no-constructible-global\",\n message\n );\n }\n\n const constructors = this.members.filter(\n (member) => member.type === \"constructor\"\n );\n for (const named of constructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have constructors.`;\n yield validationError(\n named.tokens.base,\n this,\n \"no-constructible-global\",\n message\n );\n }\n }\n\n yield* super.validate(defs);\n if (!this.partial) {\n yield* checkInterfaceMemberDuplication(defs, this);\n }\n }\n}\n\nfunction autofixConstructor(interfaceDef, constructorExtAttr) {\n interfaceDef = autoParenter(interfaceDef);\n return () => {\n const indentation = getLastIndentation(\n interfaceDef.extAttrs.tokens.open.trivia\n );\n const memberIndent = interfaceDef.members.length\n ? getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia)\n : getMemberIndentation(indentation);\n const constructorOp = Constructor.parse(\n new Tokeniser(`\\n${memberIndent}constructor();`)\n );\n constructorOp.extAttrs = new ExtendedAttributes({\n source: interfaceDef.source,\n tokens: {},\n });\n autoParenter(constructorOp).arguments = constructorExtAttr.arguments;\n\n const existingIndex = findLastIndex(\n interfaceDef.members,\n (m) => m.type === \"constructor\"\n );\n interfaceDef.members.splice(existingIndex + 1, 0, constructorOp);\n\n const { close } = interfaceDef.tokens;\n if (!close.trivia.includes(\"\\n\")) {\n close.trivia += `\\n${indentation}`;\n }\n\n const { extAttrs } = interfaceDef;\n const index = extAttrs.indexOf(constructorExtAttr);\n const removed = extAttrs.splice(index, 1);\n if (!extAttrs.length) {\n extAttrs.tokens.open = extAttrs.tokens.close = undefined;\n } else if (extAttrs.length === index) {\n extAttrs[index - 1].tokens.separator = undefined;\n } else if (!extAttrs[index].tokens.name.trivia.trim()) {\n extAttrs[index].tokens.name.trivia = removed[0].tokens.name.trivia;\n }\n };\n}\n","import { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {import(\"../productions/container.js\").Container} i\n */\nexport function* checkInterfaceMemberDuplication(defs, i) {\n const opNames = groupOperationNames(i);\n const partials = defs.partials.get(i.name) || [];\n const mixins = defs.mixinMap.get(i.name) || [];\n for (const ext of [...partials, ...mixins]) {\n const additions = getOperations(ext);\n const statics = additions.filter((a) => a.special === \"static\");\n const nonstatics = additions.filter((a) => a.special !== \"static\");\n yield* checkAdditions(statics, opNames.statics, ext, i);\n yield* checkAdditions(nonstatics, opNames.nonstatics, ext, i);\n statics.forEach((op) => opNames.statics.add(op.name));\n nonstatics.forEach((op) => opNames.nonstatics.add(op.name));\n }\n\n /**\n * @param {import(\"../productions/operation.js\").Operation[]} additions\n * @param {Set<string>} existings\n * @param {import(\"../productions/container.js\").Container} ext\n * @param {import(\"../productions/container.js\").Container} base\n */\n function* checkAdditions(additions, existings, ext, base) {\n for (const addition of additions) {\n const { name } = addition;\n if (name && existings.has(name)) {\n const isStatic = addition.special === \"static\" ? \"static \" : \"\";\n const message = `The ${isStatic}operation \"${name}\" has already been defined for the base interface \"${base.name}\" either in itself or in a mixin`;\n yield validationError(\n addition.tokens.name,\n ext,\n \"no-cross-overload\",\n message\n );\n }\n }\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n * @returns {import(\"../productions/operation.js\").Operation[]}\n */\n function getOperations(i) {\n return i.members.filter(({ type }) => type === \"operation\");\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n */\n function groupOperationNames(i) {\n const ops = getOperations(i);\n return {\n statics: new Set(\n ops.filter((op) => op.special === \"static\").map((op) => op.name)\n ),\n nonstatics: new Set(\n ops.filter((op) => op.special !== \"static\").map((op) => op.name)\n ),\n };\n }\n}\n","import { Container } from \"./container.js\";\nimport { Constant } from \"./constant.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { stringifier } from \"./helpers.js\";\n\nexport class Mixin extends Container {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {Token} base\n * @param {object} [options]\n * @param {Token} [options.partial]\n */\n static parse(tokeniser, base, { partial } = {}) {\n const tokens = { partial, base };\n tokens.mixin = tokeniser.consume(\"mixin\");\n if (!tokens.mixin) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Mixin({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n [Constant.parse],\n [stringifier],\n [Attribute.parse, { noInherit: true }],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"interface mixin\";\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n} from \"./helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { Default } from \"./default.js\";\n\nexport class Field extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Field({ source: tokeniser.source, tokens }));\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.required = tokeniser.consume(\"required\");\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"dictionary-type\") ||\n tokeniser.error(\"Dictionary member lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Dictionary member lacks a name\");\n ret.default = Default.parse(tokeniser);\n if (tokens.required && ret.default)\n tokeniser.error(\"Required member must not have a default\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated dictionary member, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"field\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get required() {\n return !!this.tokens.required;\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.required),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Container } from \"./container.js\";\nimport { Field } from \"./field.js\";\n\nexport class Dictionary extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"dictionary\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Dictionary({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [[Field.parse]],\n }\n );\n }\n\n get type() {\n return \"dictionary\";\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { validationError } from \"../error.js\";\nimport { autofixAddExposedWindow } from \"./helpers.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class Namespace extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"namespace\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Namespace({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n [Attribute.parse, { noInherit: true, readonly: true }],\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"namespace\";\n }\n\n *validate(defs) {\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\n const message = `Namespaces must have [Exposed] extended attribute. \\\nTo fix, add, for example, [Exposed=Window]. Please also consider carefully \\\nif your namespace should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n yield* super.validate(defs);\n }\n}\n","import { Container } from \"./container.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class CallbackInterface extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, callback, { partial = null } = {}) {\n const tokens = { callback };\n tokens.base = tokeniser.consume(\"interface\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new CallbackInterface({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"callback interface\";\n }\n}\n","import { Tokeniser } from \"./tokeniser.js\";\nimport { Enum } from \"./productions/enum.js\";\nimport { Includes } from \"./productions/includes.js\";\nimport { ExtendedAttributes } from \"./productions/extended-attributes.js\";\nimport { Typedef } from \"./productions/typedef.js\";\nimport { CallbackFunction } from \"./productions/callback.js\";\nimport { Interface } from \"./productions/interface.js\";\nimport { Mixin } from \"./productions/mixin.js\";\nimport { Dictionary } from \"./productions/dictionary.js\";\nimport { Namespace } from \"./productions/namespace.js\";\nimport { CallbackInterface } from \"./productions/callback-interface.js\";\nimport { autoParenter } from \"./productions/helpers.js\";\nimport { Eof } from \"./productions/token.js\";\n\n/**\n * @param {Tokeniser} tokeniser\n * @param {object} options\n * @param {boolean} [options.concrete]\n * @param {Function[]} [options.productions]\n */\nfunction parseByTokens(tokeniser, options) {\n const source = tokeniser.source;\n\n function error(str) {\n tokeniser.error(str);\n }\n\n function consume(...candidates) {\n return tokeniser.consume(...candidates);\n }\n\n function callback() {\n const callback = consume(\"callback\");\n if (!callback) return;\n if (tokeniser.probe(\"interface\")) {\n return CallbackInterface.parse(tokeniser, callback);\n }\n return CallbackFunction.parse(tokeniser, callback);\n }\n\n function interface_(opts) {\n const base = consume(\"interface\");\n if (!base) return;\n const ret =\n Mixin.parse(tokeniser, base, opts) ||\n Interface.parse(tokeniser, base, opts) ||\n error(\"Interface has no proper body\");\n return ret;\n }\n\n function partial() {\n const partial = consume(\"partial\");\n if (!partial) return;\n return (\n Dictionary.parse(tokeniser, { partial }) ||\n interface_({ partial }) ||\n Namespace.parse(tokeniser, { partial }) ||\n error(\"Partial doesn't apply to anything\")\n );\n }\n\n function definition() {\n if (options.productions) {\n for (const production of options.productions) {\n const result = production(tokeniser);\n if (result) {\n return result;\n }\n }\n }\n\n return (\n callback() ||\n interface_() ||\n partial() ||\n Dictionary.parse(tokeniser) ||\n Enum.parse(tokeniser) ||\n Typedef.parse(tokeniser) ||\n Includes.parse(tokeniser) ||\n Namespace.parse(tokeniser)\n );\n }\n\n function definitions() {\n if (!source.length) return [];\n const defs = [];\n while (true) {\n const ea = ExtendedAttributes.parse(tokeniser);\n const def = definition();\n if (!def) {\n if (ea.length) error(\"Stray extended attributes\");\n break;\n }\n autoParenter(def).extAttrs = ea;\n defs.push(def);\n }\n const eof = Eof.parse(tokeniser);\n if (options.concrete) {\n defs.push(eof);\n }\n return defs;\n }\n const res = definitions();\n if (tokeniser.position < source.length) error(\"Unrecognised tokens\");\n return res;\n}\n\n/**\n * @param {string} str\n * @param {object} [options]\n * @param {*} [options.sourceName]\n * @param {boolean} [options.concrete]\n * @param {Function[]} [options.productions]\n * @return {import(\"./productions/base.js\").Base[]}\n */\nexport function parse(str, options = {}) {\n const tokeniser = new Tokeniser(str);\n if (typeof options.sourceName !== \"undefined\") {\n // @ts-ignore (See Tokeniser.source in supplement.d.ts)\n tokeniser.source.name = options.sourceName;\n }\n return parseByTokens(tokeniser, options);\n}\n","function noop(arg) {\n return arg;\n}\n\nconst templates = {\n wrap: (items) => items.join(\"\"),\n trivia: noop,\n name: noop,\n reference: noop,\n type: noop,\n generic: noop,\n nameless: noop,\n inheritance: noop,\n definition: noop,\n extendedAttribute: noop,\n extendedAttributeReference: noop,\n};\n\nexport class Writer {\n constructor(ts) {\n this.ts = Object.assign({}, templates, ts);\n }\n\n /**\n * @param {string} raw\n * @param {object} options\n * @param {string} [options.unescaped]\n * @param {import(\"./productions/base.js\").Base} [options.context]\n * @returns\n */\n reference(raw, { unescaped, context }) {\n if (!unescaped) {\n unescaped = raw.startsWith(\"_\") ? raw.slice(1) : raw;\n }\n return this.ts.reference(raw, unescaped, context);\n }\n\n /**\n * @param {import(\"./tokeniser.js\").Token} t\n * @param {Function} wrapper\n * @param {...any} args\n * @returns\n */\n token(t, wrapper = noop, ...args) {\n if (!t) {\n return \"\";\n }\n const value = wrapper(t.value, ...args);\n return this.ts.wrap([this.ts.trivia(t.trivia), value]);\n }\n\n reference_token(t, context) {\n return this.token(t, this.reference.bind(this), { context });\n }\n\n name_token(t, arg) {\n return this.token(t, this.ts.name, arg);\n }\n\n identifier(id, context) {\n return this.ts.wrap([\n this.reference_token(id.tokens.value, context),\n this.token(id.tokens.separator),\n ]);\n }\n}\n\nexport function write(ast, { templates: ts = templates } = {}) {\n ts = Object.assign({}, templates, ts);\n\n const w = new Writer(ts);\n\n return ts.wrap(ast.map((it) => it.write(w)));\n}\n","import { validationError as error } from \"./error.js\";\n\nfunction getMixinMap(all, unique) {\n const map = new Map();\n const includes = all.filter((def) => def.type === \"includes\");\n for (const include of includes) {\n const mixin = unique.get(include.includes);\n if (!mixin) {\n continue;\n }\n const array = map.get(include.target);\n if (array) {\n array.push(mixin);\n } else {\n map.set(include.target, [mixin]);\n }\n }\n return map;\n}\n\n/**\n * @typedef {ReturnType<typeof groupDefinitions>} Definitions\n */\nfunction groupDefinitions(all) {\n const unique = new Map();\n const duplicates = new Set();\n const partials = new Map();\n for (const def of all) {\n if (def.partial) {\n const array = partials.get(def.name);\n if (array) {\n array.push(def);\n } else {\n partials.set(def.name, [def]);\n }\n continue;\n }\n if (!def.name) {\n continue;\n }\n if (!unique.has(def.name)) {\n unique.set(def.name, def);\n } else {\n duplicates.add(def);\n }\n }\n return {\n all,\n unique,\n partials,\n duplicates,\n mixinMap: getMixinMap(all, unique),\n cache: {\n typedefIncludesDictionary: new WeakMap(),\n dictionaryIncludesRequiredField: new WeakMap(),\n },\n };\n}\n\nfunction* checkDuplicatedNames({ unique, duplicates }) {\n for (const dup of duplicates) {\n const { name } = dup;\n const message = `The name \"${name}\" of type \"${\n unique.get(name).type\n }\" was already seen`;\n yield error(dup.tokens.name, dup, \"no-duplicate\", message);\n }\n}\n\nfunction* validateIterable(ast) {\n const defs = groupDefinitions(ast);\n for (const def of defs.all) {\n if (def.validate) {\n yield* def.validate(defs);\n }\n }\n yield* checkDuplicatedNames(defs);\n}\n\n// Remove this once all of our support targets expose `.flat()` by default\nfunction flatten(array) {\n if (array.flat) {\n return array.flat();\n }\n return [].concat(...array);\n}\n\n/**\n * @param {import(\"./productions/base.js\").Base[]} ast\n * @return {import(\"./error.js\").WebIDLErrorData[]} validation errors\n */\nexport function validate(ast) {\n return [...validateIterable(flatten(ast))];\n}\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (ÿ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n};\n\n// list of punctuation marks from CommonMark spec\n// without * and _ to handle the different emphasis markers * and _\ninline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.normal,\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\n */\nfunction smartypants(text) {\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n}\n\n/**\n * mangle email addresses\n * @param {string} text\n */\nfunction mangle(text) {\n let out = '',\n i,\n ch;\n\n const l = text.length;\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${level}>\\n`;\n }\n\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `<li>${text}</li>\\n`;\n }\n\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `<tbody>${body}</tbody>`;\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = parser(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...marked.defaults, ...opt };\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"👻\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside <pre> won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} text\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up 😖\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async f => {\n try {\n return await f(config, document);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: #fff;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: rgb(240, 240, 240);\n background: rgb(42, 90, 168);\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: white;\n background: rgb(42, 90, 168);\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: #193766;\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: white;\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/chjj/marked\n *\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super.code(code, language, isEscaped);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw, slugger) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n ❌\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}…\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/w3c/group.js\"),\n import(\"../src/w3c/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/w3c/style.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/w3c/level.js\"),\n import(\"../src/w3c/headers.js\"),\n import(\"../src/w3c/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/w3c/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/tables.js\"),\n import(\"../src/core/webidl.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/xref.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/dfn-index.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/webidl-index.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/core/caniuse.js\"),\n import(\"../src/core/mdn-annotation.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/search-xref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/w3c/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/webidl-clipboard.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/web-monetization.js\"),\n import(\"../src/core/before-save.js\"),\n /* Linters must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/check-internal-slots.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-captionless-tables.js\"),\n import(\"../src/core/linter-rules/no-unused-dfns.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/w3c/linter-rules/required-sections.js\"),\n import(\"../src/core/linter-rules/wpt-tests-exist.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n import(\"../src/core/linter-rules/a11y.js\"),\n import(\"../src/core/linter-rules/informative-dfn.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\n });\n}\n","// @ts-check\n/**\n * @module w3c/group\n *\n * `group` is a shorthand configuration option for specifying `wg`, `wgId`,\n * `wgURI`, and `wgPatentURI` options.\n */\n\nimport { docLink, fetchAndCache, showError } from \"../core/utils.js\";\n\nexport const name = \"w3c/group\";\n\nconst W3C_GROUPS_API = \"https://respec.org/w3c/groups/\";\nexport async function run(conf) {\n if (!conf.group) {\n return;\n }\n\n const { group } = conf;\n const groupDetails = Array.isArray(group)\n ? await getMultipleGroupDetails(group)\n : await getGroupDetails(group);\n Object.assign(conf, groupDetails);\n}\n\n/** @param {string[]} groups */\nasync function getMultipleGroupDetails(groups) {\n const details = await Promise.all(groups.map(getGroupDetails));\n /** @type {{ [key in keyof GroupDetails]: GroupDetails[key][] }} */\n const result = {\n wg: [],\n wgId: [],\n wgURI: [],\n wgPatentURI: [],\n wgPatentPolicy: [],\n groupType: [],\n };\n for (const groupDetails of details.filter(o => o)) {\n for (const key of Object.keys(result)) {\n result[key].push(groupDetails[key]);\n }\n }\n return result;\n}\n\n/**\n * @param {string} group\n * @typedef {{ wgId: number, wg: string, wgURI: string, wgPatentURI: string, wgPatentPolicy: string, groupType: W3CGroupType }} GroupDetails\n * @returns {Promise<GroupDetails|undefined>}\n */\nasync function getGroupDetails(group) {\n let type = \"\";\n let shortname = group;\n if (group.includes(\"/\")) {\n [type, shortname] = group.split(\"/\", 2);\n }\n const url = new URL(`${shortname}/${type}`, W3C_GROUPS_API);\n const res = await fetchAndCache(url.href);\n if (res.ok) {\n const json = await res.json();\n const {\n id: wgId,\n name: wg,\n patentURI: wgPatentURI,\n patentPolicy: wgPatentPolicy,\n type: groupType,\n wgURI,\n } = json;\n return { wg, wgId, wgURI, wgPatentURI, wgPatentPolicy, groupType };\n }\n\n const text = await res.text();\n let message = `Failed to fetch group details (HTTP: ${res.status}).`;\n let hint;\n if (res.status === 409) {\n [message, hint] = text.split(\"\\n\", 2);\n } else if (res.status === 404) {\n hint = docLink`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${\"[group]\"} configuration option.`;\n }\n showError(message, name, { hint });\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} 이전 `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 以前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` 直到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () => html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n>\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n</svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { ISODate, W3CDate, getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\nimport { sub } from \"../../core/pubsubhub.js\";\n\nconst localizationStrings = {\n en: {\n archives: \"archives\",\n author: \"Author:\",\n authors: \"Authors:\",\n commit_history: \"Commit history\",\n edited_in_place: \"edited in place\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n feedback: \"Feedback:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n history: \"History:\",\n implementation_report: \"Implementation report:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n latest_recommendation: \"Latest Recommendation:\",\n message_topic: \"… message topic …\",\n more_details_about_this_doc: \"More details about this document\",\n multiple_alternates(plural) {\n return `This document is also available in ${\n plural ? \"these non-normative formats\" : \"this non-normative format\"\n }:`;\n },\n prev_editor_draft: \"Previous editor's draft:\",\n prev_recommendation: \"Previous Recommendation:\",\n prev_version: \"Previous version:\",\n publication_history: \"Publication history\",\n test_suite: \"Test suite:\",\n this_version: \"This version:\",\n with_subject_line: \"with subject line\",\n your_topic_here: \"YOUR TOPIC HERE\",\n },\n ko: {\n author: \"저자:\",\n authors: \"저자:\",\n editor: \"편집자:\",\n editors: \"편집자:\",\n former_editor: \"이전 편집자:\",\n former_editors: \"이전 편집자:\",\n latest_editors_draft: \"최신 편집 초안:\",\n latest_published_version: \"최신 버전:\",\n this_version: \"현재 버전:\",\n },\n zh: {\n author: \"作者:\",\n authors: \"作者:\",\n commit_history: \"Git提交历史\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n feedback: \"反馈:\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n history: \"历史:\",\n implementation_report: \"实现报告:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n latest_recommendation: \"最新发布的正式推荐标准:\",\n message_topic: \"… 邮件主题 …\",\n prev_editor_draft: \"上一版编辑草稿:\",\n prev_recommendation: \"上一版正式推荐标准:\",\n prev_version: \"上一版:\",\n test_suite: \"测试套件:\",\n this_version: \"本版本:\",\n },\n ja: {\n archives: \"アーカイブ\",\n author: \"著者:\",\n authors: \"著者:\",\n commit_history: \"更新履歴\",\n edited_in_place: \"改版なく更新\",\n editor: \"編者:\",\n editors: \"編者:\",\n feedback: \"フィードバック:\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n history: \"履歴:\",\n implementation_report: \"実装レポート:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n latest_recommendation: \"最新の勧告版:\",\n message_topic: \"… メール件名 …\",\n more_details_about_this_doc: \"この文書についてのより詳細\",\n prev_editor_draft: \"前回の編集用草案:\",\n prev_recommendation: \"前回の勧告版:\",\n prev_version: \"前回のバージョン:\",\n publication_history: \"公表履歴\",\n test_suite: \"テストスイート:\",\n this_version: \"このバージョン:\",\n with_subject_line: \"次の件名で\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n archives: \"archivos\",\n author: \"Autor:\",\n authors: \"Autores:\",\n commit_history: \"Historial de cambios\",\n edited_in_place: \"editado en lugar\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n feedback: \"Comentarios:\",\n former_editor: \"Antiguo editor:\",\n former_editors: \"Antiguos editores:\",\n history: \"Historia:\",\n implementation_report: \"Informe de implementación:\",\n latest_editors_draft: \"Última versión del editor:\",\n latest_published_version: \"Última versión publicada:\",\n latest_recommendation: \"Recomendación más reciente:\",\n message_topic: \"… detalles de mensaje …\",\n more_details_about_this_doc: \"Más detalles sobre este documento:\",\n publication_history: \"Historial de publicación\",\n prev_editor_draft: \"Última versión del editor:\",\n prev_recommendation: \"Última Recomendación:\",\n prev_version: \"Última versión:\",\n test_suite: \"Suite de pruebas:\",\n this_version: \"Esta versión:\",\n with_subject_line: \"con línea de asunto\",\n your_topic_here: \"TU SUJETO AQUÍ\",\n },\n de: {\n archives: \"Archiv\",\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n commit_history: \"Commit-Historie\",\n edited_in_place: \"zuletzt geändert am\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n feedback: \"Feedback:\",\n former_editor: \"Frühere Mitwirkende:\",\n former_editors: \"Frühere Mitwirkende:\",\n history: \"Verlauf:\",\n implementation_report: \"Umsetzungsbericht:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n latest_recommendation: \"Aktuellste Empfehlung:\",\n more_details_about_this_doc: \"Mehr Informationen über dieses Dokument\",\n multiple_alternates(plural) {\n return `Dieses Dokument ist ebenfalls in ${\n plural\n ? \"diesen nicht-normativen Formaten verfügbar\"\n : \"diesem nicht-normativen Format verfügbar\"\n }:`;\n },\n prev_editor_draft: \"Vorheriger Entwurf:\",\n prev_recommendation: \"Vorherige Empfehlung:\",\n prev_version: \"Vorherige Version:\",\n publication_history: \"Veröffentlichungsverlauf\",\n test_suite: \"Testumgebung:\",\n this_version: \"Diese Fassung:\",\n },\n};\nexport const l10n = getIntlData(localizationStrings);\n\nexport function getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default (conf, options) => {\n /**\n * After export, we let fixup.js handle the <details>.\n */\n sub(\"beforesave\", doc => {\n const details = doc.querySelector(\".head details\");\n details.open = true;\n });\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">${renderSpecTitle(conf)}</p>\n <details open=\"${localStorage.getItem(\"tr-metadata\") || \"true\"}\">\n <summary>${l10n.more_details_about_this_doc}</summary>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>`\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.historyURI || conf.github\n ? html`<dt>${l10n.history}</dt>\n ${conf.historyURI\n ? html`<dd>\n <a href=\"${conf.historyURI}\">${conf.historyURI}</a>\n </dd>`\n : \"\"}\n ${conf.github\n ? html`<dd>\n <a href=\"${conf.github.commitHistoryURL}\"\n >${l10n.commit_history}</a\n >\n </dd>`\n : \"\"}`\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>${l10n.test_suite}</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>${l10n.implementation_report}</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.prevED\n ? html`\n <dt>${l10n.prev_editor_draft}</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n ${conf.showPreviousVersion\n ? html`\n <dt>${l10n.prev_version}</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.prevRecURI\n ? \"\"\n : conf.isRec\n ? html`\n <dt>${l10n.prev_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `\n : html`\n <dt>${l10n.latest_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `}\n ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n ${conf.errata\n ? html`<dt>Errata:</dt>\n <dd><a href=\"${conf.errata}\">Errata exists</a>.</dd>`\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n </details>\n ${conf.isRec\n ? html`<p>\n See also\n <a\n href=\"${`https://www.w3.org/Translations/?technology=${conf.shortName}`}\"\n >\n <strong>translations</strong></a\n >.\n </p>`\n : \"\"}\n ${conf.alternateFormats\n ? html`<p>\n ${l10n.multiple_alternates(options.multipleAlternates)}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n\nexport function renderFeedback(conf) {\n const definitions = [];\n // Github feedback...\n if (conf.github) {\n const { repoURL, issuesURL, newIssuesURL, pullsURL, fullName } =\n conf.github;\n definitions.push(\n html`<dd>\n <a href=\"${repoURL}\">GitHub ${fullName}</a>\n (<a href=\"${pullsURL}\">pull requests</a>,\n <a href=\"${newIssuesURL}\">new issue</a>,\n <a href=\"${issuesURL}\">open issues</a>)\n </dd>`\n );\n }\n\n // The <a href=\"mailto:list?subject\"> link for the public list\n if (conf.wgPublicList) {\n const mailToURL = new URL(`mailto:${conf.wgPublicList}@w3.org`);\n const subject =\n conf.subjectPrefix ?? `[${conf.shortName}] ${l10n.your_topic_here}`;\n const mailingListLink = html`<a\n href=\"${mailToURL.href}?subject=${encodeURIComponent(subject)}\"\n >${mailToURL.pathname}</a\n >`;\n\n // The subject line...\n const subjectLine =\n conf.subjectPrefix ||\n html`[${conf.shortName}] <em>${l10n.message_topic}</em>`;\n const emailSubject = html`${l10n.with_subject_line}${\" \"}\n <kbd>${subjectLine}</kbd>`;\n\n // Archives link\n const archiveURL = new URL(\n conf.wgPublicList,\n \"https://lists.w3.org/Archives/Public/\"\n );\n const archiveLink = html`(<a href=\"${archiveURL}\" rel=\"discussion\"\n >${l10n.archives}</a\n >)`;\n\n definitions.push(\n html`<dd>${mailingListLink} ${emailSubject} ${archiveLink}</dd>`\n );\n }\n return definitions;\n}\n\nfunction renderSpecTitle(conf) {\n const specType = conf.isCR || conf.isCRY ? conf.longStatus : conf.textStatus;\n const preamble = conf.prependW3C\n ? html`<a href=\"https://www.w3.org/standards/types#${conf.specStatus}\"\n >W3C ${specType}</a\n >`\n : html`${specType}`;\n return html`${preamble}${\" \"}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >${conf.modificationDate\n ? html`, ${l10n.edited_in_place}${\" \"}\n <time\n class=\"dt-modified\"\n datetime=\"${ISODate.format(conf.modificationDate)}\"\n >${W3CDate.format(conf.modificationDate)}</time\n >`\n : \"\"}`;\n}\n\n/**\n * @param { LicenseInfo } licenseInfo license information\n */\nfunction linkLicense(licenseInfo) {\n const { url, short, name } = licenseInfo;\n if (name === \"unlicensed\") {\n return html`. <span class=\"issue\">THIS DOCUMENT IS UNLICENSED</span>.`;\n }\n return html` and\n <a rel=\"license\" href=\"${url}\" title=\"${name}\">${short}</a> rules apply.`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.isUnofficial && conf.licenseInfo) {\n return html`<p class=\"copyright\">\n Copyright ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n the document editors/authors.\n ${conf.licenseInfo.name !== \"unlicensed\"\n ? html`Text is available under the\n <a rel=\"license\" href=\"${conf.licenseInfo.url}\"\n >${conf.licenseInfo.name}</a\n >; additional terms may apply.`\n : \"\"}\n </p>`;\n }\n return renderOfficialCopyright(conf);\n}\n\nfunction renderOfficialCopyright(conf) {\n return html`<p class=\"copyright\">\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\"\n >Copyright</a\n >\n ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n <a href=\"https://www.w3.org/\">World Wide Web Consortium</a>.\n <abbr title=\"World Wide Web Consortium\">W3C</abbr><sup>®</sup>\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\"\n >liability</a\n >,\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\"\n >trademark</a\n >${linkLicense(conf.licenseInfo)}\n </p>`;\n}\n","// @ts-check\nimport { getSpecSubTitleElem, l10n, renderFeedback } from \"./headers.js\";\nimport { W3CDate } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nexport default (conf, options) => {\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n }\n\n const specTitleElem = document.querySelector(\"h1#title\");\n const specTitleElemClone = specTitleElem.cloneNode(true);\n\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${specTitleElem} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">\n <a href=\"https://www.w3.org/standards/types#reports\"\n >${conf.longStatus}</a\n >\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >\n </p>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>`\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>Test suite:</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>Implementation report:</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.prevVersion\n ? html`\n <dt>Previous version:</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.isCGFinal\n ? html`\n ${conf.prevED\n ? html`\n <dt>Previous editor's draft:</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n `\n : \"\"}\n ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n </dl>\n ${conf.alternateFormats\n ? html`<p>\n ${options.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${existingCopyright\n ? existingCopyright\n : html`<p class=\"copyright\">\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\"\n >Copyright</a\n >\n ©\n ${conf.copyrightStart\n ? `${conf.copyrightStart}-`\n : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n the Contributors to the ${specTitleElemClone.childNodes}\n Specification, published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a> under the\n ${conf.isCGFinal\n ? html`\n <a href=\"https://www.w3.org/community/about/agreements/fsa/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >. A human-readable\n <a\n href=\"https://www.w3.org/community/about/agreements/fsa-deed/\"\n >summary</a\n >\n is available.\n `\n : html`\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >. A human-readable\n <a\n href=\"https://www.w3.org/community/about/agreements/cla-deed/\"\n >summary</a\n >\n is available.\n `}\n </p>`}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n","// @ts-check\nimport { W3CDate, getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport { status2track } from \"../headers.js\";\nconst localizationStrings = {\n en: {\n sotd: \"Status of This Document\",\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. A list of current W3C\n publications and the latest revision of this technical report can be found\n in the <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> at\n https://www.w3.org/TR/.`,\n },\n ko: {\n sotd: \"현재 문서의 상태\",\n status_at_publication: html`이 부분은 현재 문서의 발행 당시 상태에 대해\n 기술합니다. W3C 발행 문서의 최신 목록 및 테크니컬 리포트 최신판을\n https://www.w3.org/TR/ 의\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> 에서\n 열람할 수 있습니다.`,\n },\n zh: {\n sotd: \"关于本文档\",\n // eslint-disable-next-line prettier/prettier\n status_at_publication: html`本章节描述了本文档的发布状态。W3C的文档列表和最新版本可通过<a href=\"https://www.w3.org/TR/\">W3C技术报告</a>索引访问。`,\n },\n ja: {\n sotd: \"この文書の位置付け\",\n status_at_publication: html`この節には、公開時点でのこの文書の位置づけが記されている。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a>\n (https://www.w3.org/TR/)`,\n },\n nl: {\n sotd: \"Status van dit document\",\n },\n es: {\n sotd: \"Estado de este Document\",\n status_at_publication: html`Esta sección describe el estado del presente\n documento al momento de su publicación. Una lista de las publicaciones\n actuales del W3C y la última revisión del presente informe técnico puede\n hallarse en http://www.w3.org/TR/\n <a href=\"https://www.w3.org/TR/\">el índice de informes técnicos</a> del\n W3C.`,\n },\n de: {\n sotd: \"Status dieses Dokuments\",\n status_at_publication: html`Dieser Abschnitt beschreibt den Status des\n Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen\n Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann\n im <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> unter\n https://www.w3.org/TR/ abgerufen werden.`,\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nconst processLink = \"https://www.w3.org/2021/Process-20211102/\";\n\nfunction prefix(word) {\n return /^[aeiou]/i.test(word) ? `an ${word}` : `a ${word}`;\n}\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n ${conf.isUnofficial\n ? renderIsUnofficial(opts)\n : conf.isTagFinding\n ? opts.additionalContent\n : conf.isNoTrack\n ? renderIsNoTrack(conf, opts)\n : html`\n <p><em>${l10n.status_at_publication}</em></p>\n ${conf.isMemberSubmission\n ? noteForSubmission(conf, opts)\n : html`\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.overrideStatus\n ? html` ${linkToWorkingGroup(conf)} `\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.isRec ? renderIsRec(conf) : renderNotRec(conf)}\n ${renderDeliverer(conf)}\n <p>\n This document is governed by the\n <a id=\"w3c_process_revision\" href=\"${processLink}\"\n >2 November 2021 W3C Process Document</a\n >.\n </p>\n `}\n `}\n ${opts.additionalSections}\n `;\n};\n\nexport function renderPreview(conf) {\n const { prUrl, prNumber, edDraftURI } = conf;\n return html`<details class=\"annoying-warning\" open=\"\">\n <summary>\n This is a\n preview${prUrl && prNumber\n ? html`\n of pull request\n <a href=\"${prUrl}\">#${prNumber}</a>\n `\n : \"\"}\n </summary>\n <p>\n Do not attempt to implement this version of the specification. Do not\n reference this version as authoritative in any way.\n ${edDraftURI\n ? html`\n Instead, see\n <a href=\"${edDraftURI}\">${edDraftURI}</a> for the Editor's draft.\n `\n : \"\"}\n </p>\n </details>`;\n}\n\nfunction renderIsUnofficial(opts) {\n const { additionalContent } = opts;\n return html`\n <p>\n This document is a draft of a potential specification. It has no official\n standing of any kind and does not represent the support or consensus of\n any standards organization.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderIsNoTrack(conf, opts) {\n const { isMO } = conf;\n const { additionalContent } = opts;\n return html`\n <p>\n This document is merely a W3C-internal\n ${isMO ? \"member-confidential\" : \"\"} document. It has no official standing\n of any kind and does not represent consensus of the W3C Membership.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderNotRec(conf) {\n let statusExplanation = null;\n let reviewPolicy = null;\n let endorsement = html`Publication as ${prefix(conf.textStatus)} does not\n imply endorsement by W3C and its Members.`;\n let updatePolicy = html`<p>\n This is a draft document and may be updated, replaced or obsoleted by other\n documents at any time. It is inappropriate to cite this document as other\n than work in progress.\n ${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>`;\n if (conf.specStatus === \"DISC\") {\n updatePolicy = html`<p>\n Publication as a Discontinued Draft implies that this document is no\n longer intended to advance or to be maintained. It is inappropriate to\n cite this document as other than abandoned work.\n </p>`;\n }\n const lsUpdatePolicy = html`<p>\n This document is maintained and updated at any time. Some parts of this\n document are work in progress.\n </p>`;\n switch (conf.specStatus) {\n case \"STMT\":\n endorsement = html`<p>\n A W3C Statement is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"RY\":\n endorsement = html`<p>W3C recommends the wide usage of this registry.</p>\n <p>\n A W3C Registry is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"CRD\":\n statusExplanation = html`A Candidate Recommendation Draft integrates\n changes from the previous Candidate Recommendation that the Working Group\n intends to include in a subsequent Candidate Recommendation Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRYD\":\n statusExplanation = html`A Candidate Registry Draft integrates changes\n from the previous Candidate Registry Snapshot that the Working Group\n intends to include in a subsequent Candidate Registry Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRY\":\n statusExplanation = html`A Candidate Registry Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>.`;\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${conf.humanPREnd}. Advisory\n Committee Representatives should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended ${conf.humanCREnd}.\n </p>`;\n break;\n case \"CR\":\n statusExplanation = html`A Candidate Recommendation Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>, is intended to\n gather\n <a href=\"${conf.implementationReportURI}\">implementation experience</a>,\n and has commitments from Working Group members to\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.`;\n updatePolicy = html`${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}`;\n if (conf.pubMode === \"LS\") {\n reviewPolicy = html`<p>\n Comments are welcome at any time but most especially before\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n } else {\n reviewPolicy = html`<p>\n This Candidate Recommendation is not expected to advance to Proposed\n Recommendation any earlier than ${W3CDate.format(conf.crEnd)}.\n </p>`;\n }\n break;\n case \"PR\":\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${W3CDate.format(conf.prEnd)}.\n Advisory Committee Representatives should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n break;\n case \"DNOTE\":\n case \"NOTE\":\n endorsement = html`${conf.textStatus}s are not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> nor its Members.`;\n break;\n }\n return html`<p>${endorsement} ${statusExplanation}</p>\n ${updatePolicy} ${reviewPolicy}`;\n}\n\nfunction renderIsRec(conf) {\n const { updateableRec, revisionTypes = [], revisedRecEnd } = conf;\n let reviewTarget = \"\";\n if (revisionTypes.includes(\"proposed-addition\")) {\n reviewTarget = \"additions\";\n } else if (revisionTypes.includes(\"proposed-correction\")) {\n reviewTarget = \"corrections\";\n }\n return html`\n <p>\n W3C recommends the wide deployment of this specification as a standard for\n the Web.\n </p>\n\n <p>\n A W3C Recommendation is a specification that, after extensive\n consensus-building, is endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members, and\n has commitments from Working Group members to\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.\n ${updateableRec\n ? html`Future updates to this Recommendation may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>\n ${revisionTypes.includes(\"addition\")\n ? html`<p class=\"addition\">\n Candidate additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"correction\")\n ? html`<p class=\"correction\">\n Candidate corrections are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"proposed-addition\")\n ? html`<p class=\"addition proposed\">\n Proposed additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"proposed-correction\")\n ? html`<p class=\"correction proposed\">\n Proposed corrections are marked in the document.\n </p>`\n : \"\"}\n ${reviewTarget\n ? html`<p>\n The W3C Membership and other interested parties are invited to review\n the proposed ${reviewTarget} and send comments through\n ${W3CDate.format(revisedRecEnd)}. Advisory Committee Representatives\n should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\n </p>`\n : \"\"}\n `;\n}\n\nfunction renderDeliverer(conf) {\n const {\n isNote,\n isRegistry,\n wgId,\n multipleWGs,\n wgPatentHTML,\n wgPatentURI,\n wgPatentPolicy,\n } = conf;\n\n const patentPolicyURL =\n wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/Consortium/Patent-Policy/\";\n\n const producers = !(isNote || isRegistry)\n ? html`\n This document was produced by ${multipleWGs ? \"groups\" : \"a group\"}\n operating under the\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >.\n `\n : html`\n The\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >\n does not carry any licensing requirements or commitments on this\n document.\n `;\n return html`<p data-deliverer=\"${isNote || isRegistry ? wgId : null}\">\n ${producers}\n ${!(isNote || isRegistry)\n ? html`\n ${multipleWGs\n ? html` W3C maintains ${wgPatentHTML} `\n : html`\n W3C maintains a\n <a href=\"${[wgPatentURI]}\" rel=\"disclosure\"\n >public list of any patent disclosures</a\n >\n `}\n made in connection with the deliverables of\n ${multipleWGs\n ? \"each group; these pages also include\"\n : \"the group; that page also includes\"}\n instructions for disclosing a patent. An individual who has actual\n knowledge of a patent which the individual believes contains\n <a href=\"${patentPolicyURL}#def-essential\">Essential Claim(s)</a>\n must disclose the information in accordance with\n <a href=\"${patentPolicyURL}#sec-Disclosure\"\n >section 6 of the W3C Patent Policy</a\n >.\n `\n : \"\"}\n </p>`;\n}\n\nfunction noteForSubmission(conf, opts) {\n return html`\n ${opts.additionalContent}\n ${conf.isMemberSubmission ? noteForMemberSubmission(conf) : \"\"}\n `;\n}\n\nfunction noteForMemberSubmission(conf) {\n const teamComment = `https://www.w3.org/Submission/${conf.publishDate.getUTCFullYear()}/${\n conf.submissionCommentNumber\n }/Comment/`;\n\n const patentPolicyURL =\n conf.wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/Consortium/Patent-Policy/\";\n\n return html`<p>\n By publishing this document, W3C acknowledges that the\n <a href=\"${conf.thisVersion}\">Submitting Members</a> have made a formal\n Submission request to W3C for discussion. Publication of this document by\n W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or\n will be allocating any resources to the issues addressed by it. This\n document is not the product of a chartered W3C group, but is published as\n potential input to the\n <a href=\"https://www.w3.org/Consortium/Process\">W3C Process</a>. A\n <a href=\"${teamComment}\">W3C Team Comment</a> has been published in\n conjunction with this Member Submission. Publication of acknowledged Member\n Submissions at the W3C site is one of the benefits of\n <a href=\"https://www.w3.org/Consortium/Prospectus/Joining\">\n W3C Membership</a\n >. Please consult the requirements associated with Member Submissions of\n <a href=\"${patentPolicyURL}#sec-submissions\"\n >section 3.3 of the W3C Patent Policy</a\n >. Please consult the complete\n <a href=\"https://www.w3.org/Submission\"\n >list of acknowledged W3C Member Submissions</a\n >.\n </p>`;\n}\n\nexport function renderPublicList(conf, opts) {\n const { mailToWGPublicListWithSubject, mailToWGPublicListSubscription } =\n opts;\n const { wgPublicList, subjectPrefix } = conf;\n const archivesURL = `https://lists.w3.org/Archives/Public/${wgPublicList}/`;\n return html`<p>\n If you wish to make comments regarding this document, please send them to\n <a href=\"${mailToWGPublicListWithSubject}\">${wgPublicList}@w3.org</a>\n (<a href=\"${mailToWGPublicListSubscription}\">subscribe</a>,\n <a href=\"${archivesURL}\">archives</a>)${subjectPrefix\n ? html` with <code>${subjectPrefix}</code> at the start of your email's\n subject`\n : \"\"}.\n </p>`;\n}\n\nfunction linkToWorkingGroup(conf) {\n if (!conf.wg) {\n return;\n }\n let changes = null;\n if (conf.isRec && conf.revisionTypes && conf.revisionTypes.length) {\n const pa = conf.revisionTypes.includes(\"proposed-addition\");\n const pc = conf.revisionTypes.includes(\"proposed-correction\");\n const ca = conf.revisionTypes.includes(\"addition\");\n const cc = conf.revisionTypes.includes(\"correction\");\n if ((pa && pc) || (ca && cc)) {\n changes = html`It includes\n ${pa\n ? html`<a href=\"${processLink}#proposed-amendments\">\n proposed amendments</a\n >`\n : html`<a href=\"${processLink}#candidate-amendments\">\n candidate amendments</a\n >`},\n introducing substantive changes and new features since the previous\n Recommendation.`;\n } else if (pa || ca) {\n changes = html`It includes\n ${pa\n ? html`<a href=\"${processLink}#proposed-addition\">\n proposed additions</a\n >`\n : html`<a href=\"${processLink}#candidate-addition\">\n candidate additions</a\n >`},\n introducing new features since the previous Recommendation.`;\n } else if (pc || cc) {\n changes = html`It includes\n ${pc\n ? html`<a href=\"${processLink}#proposed-correction\">\n proposed corrections</a\n >`\n : html`<a href=\"${processLink}#candidate-correction\">\n candidate corrections</a\n >`}.`;\n }\n }\n const track = status2track[conf.specStatus]\n ? html` using the\n <a href=\"${processLink}#recs-and-notes\"\n >${status2track[conf.specStatus]} track</a\n >`\n : \"\";\n return html`<p>\n This document was published by ${conf.wgHTML} as\n ${prefix(conf.longStatus)}${track}. ${changes}\n </p>`;\n}\n\nexport function linkToCommunity(conf, opts) {\n if (!conf.github && !conf.wgPublicList) {\n return;\n }\n return html`<p>\n ${conf.github\n ? html`\n <a href=\"${conf.issueBase}\">GitHub Issues</a> are preferred for\n discussion of this specification.\n `\n : \"\"}\n ${conf.wgPublicList\n ? html`\n ${conf.github && conf.wgPublicList\n ? \"Alternatively, you can send comments to our mailing list.\"\n : \"Comments regarding this document are welcome.\"}\n Please send them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a href=\"${opts.mailToWGPublicListSubscription}\">subscribe</a>,\n <a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html` with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject`\n : \"\"}.\n `\n : \"\"}\n </p>`;\n}\n","// @ts-check\nimport {\n l10n,\n linkToCommunity,\n renderPreview,\n renderPublicList,\n} from \"./sotd.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n <p>\n This specification was published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a>. It is not a W3C Standard nor is it\n on the W3C Standards Track.\n ${conf.isCGFinal\n ? html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/final/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >\n other conditions apply.\n `\n : html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >\n there is a limited opt-out and other conditions apply.\n `}\n Learn more about\n <a href=\"https://www.w3.org/community/\"\n >W3C Community and Business Groups</a\n >.\n </p>\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.github && conf.wgPublicList ? renderPublicList(conf, opts) : \"\"}\n ${conf.github ? linkToCommunity(conf, opts) : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${opts.additionalSections}\n `;\n};\n","// @ts-check\n// Module w3c/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - shortName: the small name that is used after /TR/ in published reports (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - previousPublishDate: the date on which the previous version was published.\n// - previousMaturity: the specStatus of the previous version\n// - errata: the URI of the errata document, if any\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - testSuiteURI: the URI to the test suite, if any\n// - implementationReportURI: the URI to the implementation report, if any\n// - noRecTrack: set to true if this document is not intended to be on the Recommendation track\n// - edDraftURI: the URI of the Editor's Draft for this document, if any. Required if\n// specStatus is set to \"ED\".\n// - additionalCopyrightHolders: a copyright owner in addition to W3C (or the only one if specStatus\n// is unofficial)\n// - copyrightStart: the year from which the copyright starts running\n// - prevED: the URI of the previous Editor's Draft if it has moved\n// - prevRecShortname: the short name of the previous Recommendation, if the name has changed\n// - prevRecURI: the URI of the previous Recommendation if not directly generated from\n// prevRecShortname.\n// - wg: the name of the WG in charge of the document. This may be an array in which case wgURI\n// and wgPatentURI need to be arrays as well, of the same length and in the same order\n// - wgURI: the URI to the group's page, or an array of such\n// - wgPatentURI: the URI to the group's patent information page, or an array of such. NOTE: this\n// is VERY IMPORTANT information to provide and get right, do not just paste this without checking\n// that you're doing it right\n// - wgPublicList: the name of the mailing list where discussion takes place. Note that this cannot\n// be an array as it is assumed that there is a single list to discuss the document, even if it\n// is handled by multiple groups\n// - charterDisclosureURI: used for IGs (when publishing IG-NOTEs) to provide a link to the IPR commitment\n// defined in their charter.\n// - thisVersion: the URI to the dated current version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - latestVersion: the URI to the latest version of the specification.\n// - prevVersion: the URI to the previous (dated) version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - subjectPrefix: the string that is expected to be used as a subject prefix when posting to the mailing\n// list of the group.\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by\", which is experimentally available in some groups (but likely to be phased out).\n// Note that this is a dual licensing regime.\n// - \"document\", which is the old, but still available, document license.\n// - \"dual\", dual license.\n// - \"cc0\", an extremely permissive license. It is only recommended if you are working on a document that is\n// intended to be pushed to the WHATWG.\n// - \"w3c-software\", a permissive and attributions license (but GPL-compatible).\n// - \"w3c-software-doc\", (default) the W3C Software and Document License\n// https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\nimport {\n ISODate,\n codedJoinAnd,\n codedJoinOr,\n concatDate,\n docLink,\n htmlJoinAnd,\n norm,\n showError,\n showWarning,\n} from \"../core/utils.js\";\nimport cgbgHeadersTmpl from \"./templates/cgbg-headers.js\";\nimport cgbgSotdTmpl from \"./templates/cgbg-sotd.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport sotdTmpl from \"./templates/sotd.js\";\n\nexport const name = \"w3c/headers\";\n\n/**\n * Resolves against https://www.w3.org.\n * @param {string} href\n */\nfunction w3Url(href) {\n return new URL(href, \"https://www.w3.org/\").href;\n}\n\nconst status2maturity = {\n LS: \"WD\",\n LD: \"WD\",\n FPWD: \"WD\",\n};\n\nexport const status2text = {\n DNOTE: \"Group Draft Note\",\n NOTE: \"Group Note\",\n STMT: \"Statement\",\n \"Member-SUBM\": \"Member Submission\",\n MO: \"Member-Only Document\",\n ED: \"Editor's Draft\",\n LS: \"Living Standard\",\n LD: \"Living Document\",\n FPWD: \"First Public Working Draft\",\n WD: \"Working Draft\",\n CR: \"Candidate Recommendation\",\n CRD: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n PER: \"Proposed Edited Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Discontinued Draft\",\n RSCND: \"Rescinded Recommendation\",\n DRY: \"Draft Registry\",\n CRYD: \"Candidate Registry\",\n CRY: \"Candidate Registry\",\n RY: \"Registry\",\n unofficial: \"Unofficial Draft\",\n UD: \"Unofficial Draft\",\n base: \"\",\n finding: \"TAG Finding\",\n \"draft-finding\": \"Draft TAG Finding\",\n \"editor-draft-finding\": \"Draft TAG Finding\",\n \"CG-DRAFT\": \"Draft Community Group Report\",\n \"CG-FINAL\": \"Final Community Group Report\",\n \"BG-DRAFT\": \"Draft Business Group Report\",\n \"BG-FINAL\": \"Final Business Group Report\",\n};\nconst status2long = {\n ...status2text,\n CR: \"Candidate Recommendation Snapshot\",\n CRD: \"Candidate Recommendation Draft\",\n CRY: \"Candidate Registry Snapshot\",\n CRYD: \"Candidate Registry Draft\",\n};\nexport const status2track = {\n DNOTE: \"Note\",\n NOTE: \"Note\",\n STMT: \"Note\",\n \"WG-NOTE\": \"Note\",\n \"IG-NOTE\": \"Note\",\n FPWD: \"Recommendation\",\n WD: \"Recommendation\",\n CR: \"Recommendation\",\n CRD: \"Recommendation\",\n PR: \"Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Recommendation\",\n RSCND: \"Recommendation\",\n DRY: \"Registry\",\n CRYD: \"Registry\",\n CRY: \"Registry\",\n RY: \"Registry\",\n};\nexport const W3CNotes = [\"DNOTE\", \"NOTE\", \"STMT\"];\nexport const recTrackStatus = [\n \"CR\",\n \"CRD\",\n \"DISC\",\n \"FPWD\",\n \"PER\",\n \"PR\",\n \"REC\",\n \"RSCND\",\n \"WD\",\n];\nexport const registryTrackStatus = [\"DRY\", \"CRY\", \"CRYD\", \"RY\"];\nexport const tagStatus = [\"draft-finding\", \"finding\", \"editor-draft-finding\"];\nexport const cgStatus = [\"CG-DRAFT\", \"CG-FINAL\"];\nexport const bgStatus = [\"BG-DRAFT\", \"BG-FINAL\"];\nexport const cgbgStatus = [...cgStatus, ...bgStatus];\nexport const trStatus = [\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n];\nexport const noTrackStatus = [\n \"base\",\n ...cgStatus,\n ...bgStatus,\n \"editor-draft-finding\",\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\n/** @type {Map<string, LicenseInfo>} */\nexport const licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"w3c-software\",\n {\n name: \"W3C Software Notice and License\",\n short: \"W3C Software\",\n url: \"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231\",\n },\n ],\n [\n \"w3c-software-doc\",\n {\n name: \"W3C Software and Document Notice and License\",\n short: \"permissive document license\",\n url: \"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"document\",\n {\n name: \"W3C Document License\",\n short: \"document use\",\n url: \"https://www.w3.org/Consortium/Legal/copyright-documents\",\n },\n ],\n [\n \"dual\",\n {\n name: \"W3C Dual License\",\n short: \"dual license\",\n url: \"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html\",\n },\n ],\n [\n undefined,\n {\n name: \"unlicensed\",\n url: null,\n short: \"UNLICENSED\",\n },\n ],\n]);\n\nconst patentPolicies = [\"PP2017\", \"PP2020\"];\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg = docLink`${prop} is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nfunction deriveLicenseInfo(conf) {\n let license = undefined;\n if (typeof conf.license === \"string\") {\n const lCaseLicense = conf.license.toLowerCase();\n if (!licenses.has(lCaseLicense)) {\n const msg = `The license \"\\`${conf.license}\\`\" is not supported.`;\n const choices = codedJoinOr(\n [...licenses.keys()].filter(k => k),\n {\n quotes: true,\n }\n );\n const hint = docLink`Please set\n ${\"[license]\"} to one of: ${choices}. If in doubt, remove \\`license\\` and let ReSpec pick one for you.`;\n showError(msg, name, { hint });\n } else {\n license = lCaseLicense;\n }\n }\n\n if (conf.isUnofficial && !license) {\n license = \"cc-by\";\n }\n\n // W3C docs can't be CC-BY or CC0\n if (!conf.isUnofficial && [\"cc-by\", \"cc0\"].includes(license)) {\n const msg = docLink`License \"\\`${conf.license}\\`\" is not allowed for W3C Specifications.`;\n const hint = docLink`Please set ${\"[license]\"} to \\`\"w3c-software-doc\"\\` instead.`;\n showError(msg, name, { hint });\n }\n const licenseInfo = licenses.get(license);\n return licenseInfo;\n}\n\nexport async function run(conf) {\n conf.isBasic = conf.specStatus === \"base\";\n conf.isCGBG = cgbgStatus.includes(conf.specStatus);\n conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith(\"G-FINAL\");\n conf.isCR = conf.specStatus === \"CR\" || conf.specStatus === \"CRD\";\n conf.isCRDraft = conf.specStatus === \"CRD\";\n conf.isCRY = conf.specStatus === \"CRY\" || conf.specStatus === \"CRYD\";\n conf.isEd = conf.specStatus === \"ED\";\n conf.isMemberSubmission = conf.specStatus === \"Member-SUBM\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = W3CNotes.includes(conf.specStatus);\n conf.isNoTrack = noTrackStatus.includes(conf.specStatus);\n conf.isPER = conf.specStatus === \"PER\";\n conf.isPR = conf.specStatus === \"PR\";\n conf.isRecTrack = recTrackStatus.includes(conf.specStatus);\n conf.isRec = conf.isRecTrack && conf.specStatus === \"REC\";\n conf.isRegistry = registryTrackStatus.includes(conf.specStatus);\n conf.isRegular = !conf.isCGBG && !conf.isBasic;\n conf.isTagEditorFinding = conf.specStatus === \"editor-draft-finding\";\n conf.isTagFinding = tagStatus.includes(conf.specStatus);\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.licenseInfo = deriveLicenseInfo(conf);\n conf.prependW3C = !conf.isBasic && !conf.isUnofficial;\n conf.longStatus = status2long[conf.specStatus];\n conf.textStatus = status2text[conf.specStatus];\n conf.showPreviousVersion = false;\n\n if (conf.isRegular && !conf.shortName) {\n const msg = docLink`The ${\"[shortName]\"} configuration option is required for this kind of document.`;\n const hint = docLink`Please set ${\"[shortName]\"} to a short name for the specification.`;\n showError(msg, name, { hint });\n }\n\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n if (conf.modificationDate) {\n conf.modificationDate = validateDateAndRecover(\n conf,\n \"modificationDate\",\n document.lastModified\n );\n }\n\n if (conf.isRecTrack && !conf.github && !conf.wgPublicList) {\n const msg =\n \"W3C Process requires a either a link to a public repository or mailing list.\";\n const hint = docLink`Use the ${\"[github]\"} configuration option to add a link to a repository. Alternatively use ${\"[wgPublicList]\"} to link to a mailing list.`;\n showError(msg, name, {\n hint,\n });\n }\n\n if (conf.isEd && !conf.edDraftURI) {\n const msg = docLink`Editor's Drafts should set ${\"[edDraftURI]\"} configuration option.`;\n const hint = docLink`Please set ${\"[edDraftURI]\"} to the URL of the Editor's Draft. Alternatively, use the set ${\"[github]\"} option, which automatically sets it for you.`;\n showWarning(msg, name, { hint });\n }\n\n const pubSpace = derivePubSpace(conf);\n if (pubSpace && !conf.thisVersion) {\n const maturity = status2maturity[conf.specStatus] || conf.specStatus;\n const { shortName, publishDate } = conf;\n const date = concatDate(publishDate);\n const docVersion = `${maturity}-${shortName}-${date}`;\n const year = [...trStatus, \"Member-SUBM\"].includes(conf.specStatus)\n ? `${publishDate.getUTCFullYear()}/`\n : \"\";\n conf.thisVersion = w3Url(`${pubSpace}/${year}${docVersion}/`);\n }\n\n if (conf.isEd) conf.thisVersion = conf.edDraftURI;\n if (conf.isCGBG) validateCGBG(conf);\n if (conf.latestVersion !== null) {\n conf.latestVersion = conf.latestVersion\n ? w3Url(conf.latestVersion)\n : w3Url(`${pubSpace}/${conf.shortName}/`);\n }\n\n if (conf.latestVersion) validateIfAllowedOnTR(conf);\n\n const latestPath = `${pubSpace}/${conf.shortName}`;\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n const msg = docLink`${\"[`previousPublishDate`]\"} is set, but missing ${\"[`previousMaturity`]\"}.`;\n showError(msg, name);\n }\n\n conf.previousPublishDate = validateDateAndRecover(\n conf,\n \"previousPublishDate\"\n );\n\n const prevMaturity =\n status2maturity[conf.previousMaturity] ?? conf.previousMaturity;\n if (conf.isTagFinding && conf.latestVersion) {\n const pubDate = ISODate.format(conf.publishDate);\n conf.thisVersion = w3Url(`${latestPath}-${pubDate}`);\n const prevPubDate = ISODate.format(conf.previousPublishDate);\n conf.prevVersion = w3Url(`${latestPath}-${prevPubDate}}`);\n } else if (conf.isCGBG || conf.isBasic) {\n conf.prevVersion = conf.prevVersion || \"\";\n } else {\n const year = conf.previousPublishDate.getUTCFullYear();\n const { shortName } = conf;\n const date = concatDate(conf.previousPublishDate);\n conf.prevVersion = w3Url(\n `${pubSpace}/${year}/${prevMaturity}-${shortName}-${date}/`\n );\n }\n }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = w3Url(`${pubSpace}/${conf.prevRecShortname}`);\n\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n\n if (conf.editors.length === 0) {\n const msg = \"At least one editor is required.\";\n const hint = docLink`Add one or more editors using the ${\"[editors]\"} configuration option.`;\n showError(msg, name, { hint });\n } else if (conf.editors.length && conf.isRecTrack) {\n // check that every editor has w3cid\n conf.editors.forEach((editor, i) => {\n if (editor.w3cid) return;\n const msg = docLink`Editor ${\n editor.name ? `\"${editor.name}\"` : `number ${i + 1}`\n } is missing their ${\"[w3cid]\"}.`;\n const hint = docLink`See ${\"[w3cid]\"} for instructions for how to retrieve it and add it.`;\n showError(msg, name, { hint });\n });\n }\n\n if (conf.alternateFormats?.some(({ uri, label }) => !uri || !label)) {\n const msg = docLink`Every ${\"[`alternateFormats`]\"} entry must have a \\`uri\\` and a \\`label\\`.`;\n showError(msg, name);\n }\n if (conf.copyrightStart == conf.publishYear) conf.copyrightStart = \"\";\n if (conf.isRec && !conf.errata && !conf.revisionTypes?.length) {\n const msg = \"Recommendations must have an errata link.\";\n const hint = docLink`Add an ${\"[errata]\"} URL to your ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n conf.shortISODate = ISODate.format(conf.publishDate);\n validatePatentPolicies(conf);\n await deriveHistoryURI(conf);\n if (conf.isTagEditorFinding) {\n delete conf.thisVersion;\n delete conf.latestVersion;\n }\n if (conf.isTagFinding) {\n conf.showPreviousVersion = conf.previousPublishDate ? true : false;\n }\n // configuration done - yay!\n\n const options = {\n get multipleAlternates() {\n return conf.alternateFormats && conf.alternateFormats.length > 1;\n },\n get alternatesHTML() {\n return (\n conf.alternateFormats &&\n htmlJoinAnd(\n // We need to pass a string here...\n conf.alternateFormats.map(({ label }) => label),\n (_, i) => {\n const alt = conf.alternateFormats[i];\n return html`<a\n rel=\"alternate\"\n href=\"${alt.uri}\"\n hreflang=\"${alt?.lang ?? null}\"\n type=\"${alt?.type ?? null}\"\n >${alt.label}</a\n >`;\n }\n )\n );\n },\n };\n\n // insert into document\n const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf, options);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // handle SotD\n const sotd =\n document.getElementById(\"sotd\") || document.createElement(\"section\");\n if ((conf.isCGBG || !conf.isNoTrack || conf.isTagFinding) && !sotd.id) {\n const msg =\n \"A Status of This Document must include at least on custom paragraph.\";\n const hint =\n \"Add a `<p>` in the 'sotd' section that reflects the status of this specification.\";\n showError(msg, name, { elements: [sotd], hint });\n }\n sotd.id = sotd.id || \"sotd\";\n sotd.classList.add(\"introductory\");\n // NOTE:\n // When arrays, wg and wgURI have to be the same length (and in the same order).\n // Technically wgURI could be longer but the rest is ignored.\n // However wgPatentURI can be shorter. This covers the case where multiple groups\n // publish together but some aren't used for patent policy purposes (typically this\n // happens when one is foolish enough to do joint work with the TAG). In such cases,\n // the groups whose patent policy applies need to be listed first, and wgPatentURI\n // can be shorter — but it still needs to be an array.\n const wgPotentialArray = [conf.wg, conf.wgURI, conf.wgPatentURI];\n if (\n wgPotentialArray.some(item => Array.isArray(item)) &&\n !wgPotentialArray.every(item => Array.isArray(item))\n ) {\n const msg = docLink`If one of ${\"[wg]\"}, ${\"[wgURI]\"}, or ${\"[wgPatentURI]\"} is an array, they all have to be.`;\n const hint = docLink`Use the ${\"[group]\"} option with an array instead.`;\n showError(msg, name, { hint });\n }\n if (Array.isArray(conf.wg)) {\n conf.multipleWGs = conf.wg.length > 1;\n conf.wgHTML = htmlJoinAnd(conf.wg, (wg, idx) => {\n return html`the <a href=\"${conf.wgURI[idx]}\">${wg}</a>`;\n });\n\n conf.wgPatentHTML = htmlJoinAnd(conf.wg, (wg, i) => {\n return html`a\n <a href=\"${conf.wgPatentURI[i]}\" rel=\"disclosure\"\n >public list of any patent disclosures (${wg})</a\n >`;\n });\n } else {\n conf.multipleWGs = false;\n if (conf.wg) {\n conf.wgHTML = html`the <a href=\"${conf.wgURI}\">${conf.wg}</a>`;\n }\n }\n if (conf.isPR && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"} (needed to indicate end of previous CR).`;\n showError(msg, name);\n }\n\n if (conf.isCR && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"CR\", but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.crEnd = validateDateAndRecover(conf, \"crEnd\");\n\n if (conf.isPr && !conf.prEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[prEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.prEnd = validateDateAndRecover(conf, \"prEnd\");\n\n if (conf.isPER && !conf.perEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PER\", but no ${\"[perEnd]\"} is specified.`;\n showError(msg, name);\n }\n conf.perEnd = validateDateAndRecover(conf, \"perEnd\");\n\n if (conf.hasOwnProperty(\"updateableRec\")) {\n const msg = \"Configuration option `updateableRec` is deprecated.\";\n const hint = docLink`Add an ${\"[`updateable-rec`|#updateable-rec-class]\"} CSS class to the Status of This Document section instead.`;\n showWarning(msg, name, { hint });\n if (conf.updateableRec) {\n sotd.classList.add(\"updateable-rec\");\n }\n }\n\n conf.updateableRec = sotd.classList.contains(\"updateable-rec\");\n const revisionTypes = [\n \"addition\",\n \"correction\",\n \"proposed-addition\",\n \"proposed-correction\",\n ];\n if (conf.isRec && conf.revisionTypes?.length > 0) {\n if (conf.revisionTypes.some(x => !revisionTypes.includes(x))) {\n const unknownRevisionTypes = conf.revisionTypes.filter(\n x => !revisionTypes.includes(x)\n );\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with unknown ${\"[revisionTypes]\"}: '${codedJoinOr(\n unknownRevisionTypes\n )}'.`;\n const hint = docLink`The valid values for ${\"[revisionTypes]\"} are: ${codedJoinOr(\n revisionTypes\n )}.`;\n showError(msg, name, { hint });\n }\n if (\n (conf.revisionTypes.includes(\"proposed-addition\") ||\n conf.revisionTypes.includes(\"addition\")) &&\n !conf.updateableRec\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed additions but the Recommendation is not marked as allowing new features.`;\n showError(msg, name);\n }\n }\n\n if (\n conf.specStatus === \"REC\" &&\n conf.updateableRec &&\n conf.revisionTypes &&\n conf.revisionTypes.length > 0 &&\n [\"proposed-addition\", \"proposed-correction\"].some(type =>\n conf.revisionTypes.includes(type)\n ) &&\n !conf.revisedRecEnd\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed corrections or additions but no ${\"[revisedRecEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.revisedRecEnd = validateDateAndRecover(conf, \"revisedRecEnd\");\n\n if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) {\n const msg = docLink`Document configured as ${\"[noRecTrack]\"}, but its status (\"${\n conf.specStatus\n }\") puts it on the W3C Rec Track.`;\n const notAllowed = codedJoinOr(recTrackStatus, { quotes: true });\n const hint = `Status **can't** be any of: ${notAllowed}.`;\n showError(msg, name, { hint });\n }\n if (!sotd.classList.contains(\"override\")) {\n html.bind(sotd)`${populateSoTD(conf, sotd)}`;\n }\n\n if (!conf.implementationReportURI && conf.isCR) {\n const msg = docLink`Missing ${\"[implementationReportURI]\"} configuration option in ${\"[respecConfig]\"}.`;\n const hint = docLink`CR documents must have an ${\"[implementationReportURI]\"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;\n showError(msg, name, { hint });\n }\n if (!conf.implementationReportURI && conf.isPR) {\n const msg = docLink`PR documents should include an ${\"[implementationReportURI]\"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;\n showWarning(msg, name);\n }\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: norm(\n document.getElementById(\"w3c-state\")?.textContent ?? \"\"\n ),\n });\n}\n\nfunction validateIfAllowedOnTR(conf) {\n const latestVersionURL = new URL(conf.latestVersion);\n const isW3C =\n latestVersionURL.origin === \"https://www.w3.org\" ||\n latestVersionURL.origin === \"https://w3.org/\";\n if (\n isW3C &&\n latestVersionURL.pathname.startsWith(\"/TR/\") &&\n [\"ED\", ...trStatus].includes(conf.specStatus) === false\n ) {\n const msg = docLink`Documents with a status of \\`\"${conf.specStatus}\"\\` can't be published on the W3C's /TR/ (Technical Report) space.`;\n const hint = docLink`Ask a W3C Team Member for a W3C URL where the report can be published and change ${\"[latestVersion]\"} to something else.`;\n showError(msg, name, { hint });\n return;\n }\n}\n\nfunction derivePubSpace(conf) {\n const { specStatus, group } = conf;\n if (trStatus.includes(specStatus) || conf.groupType === \"wg\") {\n return `/TR`;\n }\n\n switch (specStatus) {\n case \"CG-FINAL\":\n case \"BG-FINAL\":\n return `/community/reports/${group}`;\n case \"finding\":\n case \"draft-finding\":\n return \"/2001/tag/doc\";\n case \"Member-SUBM\":\n return `/Submission`;\n }\n\n return \"\";\n}\n\nfunction validateCGBG(conf) {\n const reportType = status2text[conf.specStatus];\n const latestVersionURL = conf.latestVersion\n ? new URL(w3Url(conf.latestVersion))\n : null;\n\n if (!conf.wg) {\n const msg = docLink`The ${\"[group]\"} configuration option is required for this kind of document (${reportType}).`;\n showError(msg, name);\n return;\n }\n\n // Deal with final reports\n if (conf.isCGFinal) {\n // Final report require a w3.org URL.\n const isW3C =\n latestVersionURL?.origin === \"https://www.w3.org\" ||\n latestVersionURL?.origin === \"https://w3.org/\";\n if (isW3C === false) {\n const msg = docLink`For ${reportType}, the ${\"[latestVersion]\"} URL must point to somewhere at https://www.w3.org/.`;\n const hint = `Ask a W3C Team Member for a W3C URL where the report can be published.`;\n showError(msg, name, { hint });\n return;\n }\n }\n}\n\nasync function deriveHistoryURI(conf) {\n if (!conf.shortName || conf.historyURI === null || !conf.latestVersion) {\n return; // Nothing to do\n }\n\n const canShowHistory = conf.isEd || trStatus.includes(conf.specStatus);\n\n if (conf.historyURI && !canShowHistory) {\n const msg = docLink`The ${\"[historyURI]\"} can't be used with non /TR/ documents.`;\n const hint = docLink`Please remove ${\"[historyURI]\"}.`;\n showError(msg, name, { hint });\n conf.historyURI = null;\n return;\n }\n\n const historyURL = new URL(\n conf.historyURI ?? conf.shortName,\n \"https://www.w3.org/standards/history/\"\n );\n\n // If it's on the Rec Track or it's TR worthy, then allow history override.\n // Also make a an exception for FPWD, DNOTE, NOTE and DRY.\n if (\n (conf.historyURI && canShowHistory) ||\n [\"FPWD\", \"DNOTE\", \"NOTE\", \"DRY\"].includes(conf.specStatus)\n ) {\n conf.historyURI = historyURL.href;\n return;\n }\n\n // Let's get the history from the W3C.\n // Do a fetch HEAD request to see if the history exists...\n // We don't discriminate... if it's on the W3C website with a history,\n // we show it.\n try {\n const response = await fetch(historyURL, { method: \"HEAD\" });\n if (response.ok) {\n conf.historyURI = response.url;\n }\n } catch {\n // Ignore fetch errors\n }\n}\n\nfunction validatePatentPolicies(conf) {\n if (!conf.wgPatentPolicy) return;\n const policies = new Set([].concat(conf.wgPatentPolicy));\n if (\n policies.size &&\n ![...policies].every(policy => patentPolicies.includes(policy))\n ) {\n const invalidPolicies = [...policies].filter(\n policy => !patentPolicies.includes(policy)\n );\n const msg = docLink`Invalid ${\"[wgPatentPolicy]\"} value(s): ${codedJoinAnd(\n invalidPolicies\n )}.`;\n const hint = `Please use one of: ${codedJoinOr(patentPolicies)}.`;\n showError(msg, name, { hint });\n }\n if (policies.size !== 1) {\n const msg =\n \"When collaborating across multiple groups, they must use the same patent policy.\";\n const hint = docLink`For ${\"[wgPatentPolicy]\"}, please check the patent policies of each group. The patent policies were: ${[\n ...policies,\n ].join(\", \")}.`;\n showError(msg, name, { hint });\n }\n // We take the first policy\n conf.wgPatentPolicy = [...policies][0];\n}\n\n/**\n * @param {*} conf\n * @param {HTMLElement} sotd\n */\nfunction populateSoTD(conf, sotd) {\n const options = {\n ...collectSotdContent(sotd, conf),\n\n get mailToWGPublicList() {\n return `mailto:${conf.wgPublicList}@w3.org`;\n },\n get mailToWGPublicListWithSubject() {\n const fragment = conf.subjectPrefix\n ? `?subject=${encodeURIComponent(conf.subjectPrefix)}`\n : \"\";\n return this.mailToWGPublicList + fragment;\n },\n get mailToWGPublicListSubscription() {\n return `mailto:${conf.wgPublicList}-request@w3.org?subject=subscribe`;\n },\n };\n const template = conf.isCGBG ? cgbgSotdTmpl : sotdTmpl;\n return template(conf, options);\n}\n\n/**\n * @param {HTMLElement} sotd\n */\nfunction collectSotdContent(sotd, { isTagFinding = false }) {\n const sotdClone = sotd.cloneNode(true);\n const additionalContent = document.createDocumentFragment();\n // we collect everything until we hit a section,\n // that becomes the custom content.\n while (sotdClone.hasChildNodes()) {\n if (\n sotdClone.nodeType === Node.ELEMENT_NODE &&\n // @ts-ignore\n sotdClone.firstChild.localName === \"section\"\n ) {\n break;\n }\n additionalContent.appendChild(sotdClone.firstChild);\n }\n if (isTagFinding && !additionalContent.hasChildNodes()) {\n const msg = docLink`ReSpec does not support automated SotD generation for TAG findings.`;\n const hint = `Please add the prerequisite content in the 'sotd' section.`;\n showWarning(msg, name, { hint });\n }\n return {\n additionalContent,\n // Whatever sections are left, we throw at the end.\n additionalSections: sotdClone.childNodes,\n };\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for W3C specs\n */\nexport const name = \"w3c/defaults\";\nimport {\n W3CNotes,\n bgStatus,\n cgStatus,\n recTrackStatus,\n registryTrackStatus,\n status2text,\n tagStatus,\n trStatus,\n} from \"./headers.js\";\nimport { codedJoinOr, docLink, showError } from \"../core/utils.js\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst w3cLogo = {\n src: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n alt: \"W3C\",\n height: 48,\n width: 72,\n url: \"https://www.w3.org/\",\n};\n\nconst memSubmissionLogo = {\n alt: \"W3C Member Submission\",\n href: \"https://www.w3.org/Submission/\",\n src: \"https://www.w3.org/Icons/member_subm-v.svg\",\n width: \"211\",\n height: \"48\",\n};\n\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": false,\n \"required-sections\": true,\n \"wpt-tests-exist\": false,\n \"informative-dfn\": \"warn\",\n \"no-unused-dfns\": \"warn\",\n a11y: false,\n },\n doJsonLd: false,\n logos: [],\n xref: true,\n wgId: \"\",\n otherLinks: [],\n excludeGithubLinks: true,\n subtitle: \"\",\n prevVersion: \"\",\n formerEditors: [],\n editors: [],\n authors: [],\n};\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...w3cDefaults.lint,\n ...conf.lint,\n };\n\n Object.assign(conf, {\n ...coreDefaults,\n ...w3cDefaults,\n ...conf,\n lint,\n });\n\n if (conf.specStatus !== \"unofficial\" && !conf.hasOwnProperty(\"license\")) {\n conf.license = \"w3c-software-doc\";\n }\n\n validateStatusForGroup(conf);\n processLogos(conf);\n}\n\nfunction processLogos(conf) {\n // Primarily include the W3C logo and license for W3C Recommendation track\n // that have an actual working group.\n const { specStatus, wg } = conf;\n const isWgStatus = [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n ...tagStatus,\n \"ED\",\n ].includes(specStatus);\n const inWorkingGroup = wg && wg.length && isWgStatus;\n // Member submissions don't need to be in a Working Group.\n const doesNotNeedWG = [\"Member-SUBM\"].includes(specStatus);\n const canShowW3CLogo = inWorkingGroup || doesNotNeedWG;\n if (canShowW3CLogo) {\n conf.logos.unshift(w3cLogo);\n if (specStatus === \"Member-SUBM\") {\n conf.logos.push(memSubmissionLogo);\n }\n }\n}\n\nfunction validateStatusForGroup(conf) {\n const { specStatus, groupType, group } = conf;\n\n if (!specStatus) {\n const msg = docLink`The ${\"[specStatus]\"} configuration option is required.`;\n const hint = docLink`Select an appropriate status from ${\"[specStatus]\"} based on your W3C group. If in doubt, use \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n if (status2text[specStatus] === undefined) {\n const msg = docLink`The ${\"[specStatus]\"} \"\\`${specStatus}\\`\" is not supported at for this type of document.`;\n const choices = codedJoinOr(Object.keys(status2text), { quotes: true });\n const hint = docLink`set ${\"[specStatus]\"} to one of: ${choices}.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n switch (groupType) {\n case \"cg\": {\n if (![...cgStatus, \"unofficial\", \"UD\"].includes(specStatus)) {\n const msg = docLink`W3C Community Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(cgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"CG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"CG-DRAFT\";\n }\n break;\n }\n case \"bg\": {\n if (![...bgStatus, \"unofficial\", \"UD\"].includes(specStatus)) {\n const msg = docLink`W3C Business Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(bgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"BG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"BG-DRAFT\";\n }\n break;\n }\n case \"wg\": {\n if (![...trStatus, \"unofficial\", \"UD\", \"ED\"].includes(specStatus)) {\n const msg = docLink`W3C Working Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const hint = docLink`Pleas see ${\"[specStatus]\"} for appropriate status for W3C Working Group documents.`;\n showError(msg, name, { hint });\n }\n break;\n }\n case \"other\":\n if (\n group === \"tag\" &&\n ![\"ED\", ...trStatus, ...tagStatus].includes(specStatus)\n ) {\n const msg = docLink`The W3C Technical Architecture Group's documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr([\"ED\", ...trStatus, ...tagStatus], {\n quotes: true,\n });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"unofficial\";\n }\n break;\n default:\n if (\n !conf.wgId &&\n ![\"unofficial\", \"base\", \"UD\", \"Member-SUBM\"].includes(conf.specStatus)\n ) {\n const msg =\n \"Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.\";\n const hint = docLink`Use the ${\"[group]\"} configuration option to associated this document with a W3C group.`;\n conf.specStatus = \"base\";\n showError(msg, name, { hint });\n }\n }\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\n\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module w3c/style\n// Inserts a link to the appropriate W3C style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { createResourceHint, linkCSS } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"w3c/style\";\n\nfunction attachFixupScript() {\n const script = html`<script src=\"https://www.w3.org/scripts/TR/2021/fixup.js\">`;\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n document.body.appendChild(script);\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2021/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2021/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all specs show the logo.\n href: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n as: \"image\",\n corsMode: \"anonymous\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(html`<link\n rel=\"stylesheet\"\n href=\"https://www.w3.org/StyleSheets/TR/2021/base.css\"\n class=\"removeOnSave\"\n/>`);\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(\n html`<meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"\n />`\n );\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n const canonicalStatus = conf.specStatus?.toUpperCase() ?? \"\";\n let styleFile = \"\";\n const canUseW3CStyle =\n [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n \"ED\",\n \"MEMBER-SUBM\",\n ].includes(canonicalStatus) && conf.wgId;\n\n // Figure out which style file to use.\n switch (canonicalStatus) {\n case \"WD\":\n case \"FPWD\":\n styleFile = canUseW3CStyle ? \"W3C-WD\" : \"base.css\";\n break;\n case \"CG-DRAFT\":\n case \"CG-FINAL\":\n case \"BG-DRAFT\":\n case \"BG-FINAL\":\n styleFile = canonicalStatus.toLowerCase();\n break;\n case \"UD\":\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"FINDING\":\n case \"DRAFT-FINDING\":\n case \"EDITOR-DRAFT-FINDING\":\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n default:\n styleFile = canUseW3CStyle ? `W3C-${conf.specStatus}` : \"base.css\";\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\"end-all\", attachFixupScript, { once: true });\n }\n const finalStyleURL = new URL(\n `/StyleSheets/TR/2021/${styleFile}`,\n \"https://www.w3.org/\"\n );\n linkCSS(document, finalStyleURL.href);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"참여\",\n },\n zh: {\n file_a_bug: \"反馈错误\",\n participate: \"参与:\",\n },\n ja: {\n commit_history: \"変更履歴\",\n file_a_bug: \"問題報告\",\n participate: \"参加方法:\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${\n ghURL.href\n }).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"无标题\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","/**\n * This module updates the title and shortName\n * of a spec when there is a valid level configuration.\n *\n * Levels should be integers >= 0.\n */\n\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"w3c/level\";\n\nconst localizationStrings = {\n en: {\n level: \"Level\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.hasOwnProperty(\"level\")) return;\n\n const h1Elem = document.querySelector(\"h1#title\");\n\n const level = parseInt(conf.level);\n if (!Number.isInteger(level) || level < 0) {\n const msg = `The \\`level\\` configuration option must be a number greater or equal to 0. It is currently set to \\`${level}\\``;\n const title = \"Invalid level config.\";\n showError(msg, name, { title, elements: [h1Elem] });\n return;\n }\n\n h1Elem.append(` ${l10n.level} ${level}`);\n document.title = `${document.title} ${l10n.level} ${level}`;\n conf.shortName = `${conf.shortName}-${level}`;\n conf.level = level;\n}\n","// @ts-check\n// Module w3c/abstract\n// Handle the abstract section properly.\nimport { getIntlData, norm, renameElement, showError } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nexport const name = \"w3c/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n ko: {\n abstract: \"요약\",\n },\n zh: {\n abstract: \"摘要\",\n },\n ja: {\n abstract: \"要約\",\n },\n nl: {\n abstract: \"Samenvatting\",\n },\n es: {\n abstract: \"Resumen\",\n },\n de: {\n abstract: \"Zusammenfassung\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abstract = findAbstract();\n if (!abstract) {\n const msg = 'Document must have one `<section id=\"abstract\">`.';\n showError(msg, name);\n return;\n }\n abstract.classList.add(\"introductory\");\n abstract.id = \"abstract\";\n if (!abstract.querySelector(\"h2\")) {\n abstract.prepend(html`<h2>${l10n.abstract}</h2>`);\n }\n}\n\nfunction findAbstract() {\n /** @type {HTMLElement} */\n const abstract = document.querySelector(\"#abstract\");\n if (abstract) {\n switch (abstract.localName) {\n case \"section\":\n return abstract;\n case \"div\":\n // Legacy documents may use a div\n return renameElement(abstract, \"section\");\n default:\n showError(\"The abstract should be a `<section>` element.\", name, {\n elements: [abstract],\n });\n return abstract;\n }\n }\n\n // Let's try find it by checking the headings.\n // This can happen if the document was generated\n // using markdown.\n const searchString = l10n.abstract.toLowerCase();\n for (const header of document.querySelectorAll(\"h2, h3, h4, h5, h6\")) {\n const contents = norm(header.textContent).toLowerCase();\n if (contents === searchString) {\n return header.closest(\"section\");\n }\n }\n return null;\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/w3c/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"참조\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参照用参考文献\",\n norm_references: \"規範的参考文献\",\n references: \"参考文献\",\n },\n de: {\n info_references: \"Weiterführende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"非规范性引用\",\n norm_references: \"规范性引用\",\n references: \"参考文献\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY?\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module w3c/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"w3c/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die Schlüsselwörter\" : \"Das Schlüsselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemäß\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter Berücksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groß geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n sub(\"plugins-done\", addContractDefaults);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"예시\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n}\n\n.warning-title:before {\n content: \"⚠\"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"注\",\n editors_note: \"編者注\",\n feature_at_risk: \"(変更の可能性のある機能) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue の要約\",\n no_issues_in_spec: \"この仕様には未解決の issues は含まれていません.\",\n warning: \"警告\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"Cuestión\",\n issue_summary: \"Resumen de la cuestión\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificación.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthält keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"编者注\",\n feature_at_risk: \"(有可能变动的特性)Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 总结\",\n no_issues_in_spec: \"本规范中未列出任何 issue。\",\n note: \"注\",\n warning: \"警告\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"最良実施例 \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"最佳实践 \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"図のリスト\",\n },\n ko: {\n fig: \"그림 \",\n list_of_figures: \"그림 목록\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范中包含的图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n normalizeImages(document);\n\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n// Module core/tables\n// Handles tables in the document.\n// Generates a List of Tables wherever there is a #list-of-tables element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/tables\";\n\nconst localizationStrings = {\n en: {\n list_of_tables: \"List of Tables\",\n table: \"Table \",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const listOfTables = collectTables();\n const listOfTablesElement = document.querySelector(\"section#list-of-tables\");\n if (listOfTables.length && listOfTablesElement) {\n decorateListOfTables(listOfTablesElement);\n listOfTablesElement.append(\n html`<h1>${l10n.list_of_tables}</h1>`,\n html`<ul class=\"list-of-tables\">\n ${listOfTables}\n </ul>`\n );\n }\n}\n\n/**\n * process all tables\n */\nfunction collectTables() {\n /** @type {HTMLLIElement[]} */\n const listOfTables = [];\n /** @type {NodeListOf<HTMLTableElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n [...tables]\n // there is a separate linter rule to catch numbered tables without captions\n .filter(table => !!table.querySelector(\"caption\"))\n .forEach((table, i) => {\n const caption = table.querySelector(\"caption\");\n decorateTable(table, caption, i);\n listOfTables.push(getListOfTablesListItem(table.id, caption));\n });\n return listOfTables;\n}\n\n/**\n * @param {HTMLTableElement} table\n * @param {HTMLTableCaptionElement} caption\n * @param {number} i\n */\nfunction decorateTable(table, caption, i) {\n const title = caption.textContent;\n addId(table, \"table\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"table-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${table.id}\"\n >${l10n.table}<bdi class=\"tableno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} tableId\n * @param {HTMLTableCaptionElement} caption\n * @return {HTMLLIElement}\n */\nfunction getListOfTablesListItem(tableId, caption) {\n const listOfTablesCaption = caption.cloneNode(true);\n for (const anchor of listOfTablesCaption.querySelectorAll(\"a\")) {\n renameElement(anchor, \"span\", { copyAttributes: false });\n }\n return html`<li>\n <a class=\"tocxref\" href=\"${`#${tableId}`}\"\n >${listOfTablesCaption.childNodes}</a\n >\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} listOfTablesElement\n */\nfunction decorateListOfTables(listOfTablesElement) {\n if (\n listOfTablesElement.matches(\".appendix, .introductory\") ||\n listOfTablesElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(listOfTablesElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n listOfTablesElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n listOfTablesElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\nimport { definitionMap, registerDefinition } from \"./dfn-map.js\";\nimport { showError, wrapInner } from \"./utils.js\";\n\nconst topLevelEntities = new Set([\n \"callback interface\",\n \"callback\",\n \"dictionary\",\n \"enum\",\n \"interface mixin\",\n \"interface\",\n \"typedef\",\n]);\n\n/**\n * This function looks for a <dfn> element whose title is 'name' and\n * that is \"for\" 'parent', which is the empty string when 'name'\n * refers to a top-level entity. For top-level entities, <dfn>\n * elements that inherit a non-empty [dfn-for] attribute are also\n * counted as matching.\n *\n * When a matching <dfn> is found, it's given <code> formatting,\n * marked as an IDL definition, and returned. If no <dfn> is found,\n * the function returns 'undefined'.\n * @param {*} defn\n * @param {string} name\n */\nexport function findDfn(defn, name, { parent = \"\" } = {}) {\n switch (defn.type) {\n case \"constructor\":\n case \"operation\":\n return findOperationDfn(defn, parent, name);\n default:\n return findNormalDfn(defn, parent, name);\n }\n}\n\n/**\n * @param {{ type: string, arguments: any[] }} idlAst\n * @param {string} parent\n * @param {string} name\n */\nfunction getAlternativeNames(idlAst, parent, name) {\n const { type } = idlAst;\n const asQualifiedName = `${parent}.${name}`;\n switch (type) {\n case \"constructor\":\n case \"operation\": {\n // Allow linking to \"method()\", method(arg) and \"method\" name.\n const asMethodName = `${name}()`;\n const asFullyQualifiedName = `${asQualifiedName}()`;\n const asMethodWithArgs = generateMethodNamesWithArgs(\n name,\n idlAst.arguments\n );\n return {\n local: [asQualifiedName, asFullyQualifiedName, name],\n exportable: [asMethodName, ...asMethodWithArgs],\n };\n }\n case \"attribute\":\n return {\n local: [asQualifiedName],\n exportable: [name],\n };\n }\n}\n\n/**\n * Generates all possible permutations of a method name based\n * on what arguments they method accepts.\n\n * Required arguments are always present, and optional ones\n * are stacked one by one.\n *\n * For examples: foo(req1, req2), foo(req1, req2, opt1) and so on.\n *\n * @param {String} operationName\n * @param {*} argsAst\n */\nfunction generateMethodNamesWithArgs(operationName, argsAst) {\n const operationNames = [];\n if (argsAst.length === 0) {\n return operationNames;\n }\n const required = []; // required arguments\n const optional = []; // optional arguments, including variadic ones\n for (const { name, optional: isOptional, variadic } of argsAst) {\n if (isOptional || variadic) {\n optional.push(name);\n } else {\n required.push(name);\n }\n }\n const requiredArgs = required.join(\", \");\n const requiredOperation = `${operationName}(${requiredArgs})`;\n operationNames.push(requiredOperation);\n const optionalOps = optional.map((_, index) => {\n const args = [...required, ...optional.slice(0, index + 1)].join(\", \");\n const result = `${operationName}(${args})`;\n return result;\n });\n operationNames.push(...optionalOps);\n return operationNames;\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {string} name\n */\nfunction findOperationDfn(defn, parent, name) {\n // Overloads all have unique names\n if (name.includes(\"!overload\")) {\n return findNormalDfn(defn, parent, name);\n }\n const asMethodName = `${name}()`;\n return findNormalDfn(defn, parent, asMethodName, name);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {Record<\"local\" | \"exportable\", string[]>} names\n */\nfunction addAlternativeNames(dfn, names) {\n const { local, exportable } = names;\n const lt = dfn.dataset.lt ? new Set(dfn.dataset.lt.split(\"|\")) : new Set();\n for (const item of exportable) {\n lt.add(item);\n }\n // Fix any ill-placed ones - local ones don't belong here\n local.filter(item => lt.has(item)).forEach(item => lt.delete(item));\n dfn.dataset.lt = [...lt].join(\"|\");\n dfn.dataset.localLt = local.join(\"|\");\n registerDefinition(dfn, [...local, ...exportable]);\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {...string} names\n */\nfunction findNormalDfn(defn, parent, ...names) {\n const { type } = defn;\n for (const name of names) {\n let resolvedName =\n type === \"enum-value\" && name === \"\" ? \"the-empty-string\" : name;\n let dfns = getDfns(resolvedName, parent, name, type);\n // If we haven't found any definitions with explicit [for]\n // and [title], look for a dotted definition, \"parent.name\".\n if (dfns.length === 0 && parent !== \"\") {\n resolvedName = `${parent}.${resolvedName}`;\n const alternativeDfns = definitionMap.get(resolvedName);\n if (alternativeDfns && alternativeDfns.size === 1) {\n dfns = [...alternativeDfns];\n registerDefinition(dfns[0], [resolvedName]);\n }\n } else {\n resolvedName = name;\n }\n if (dfns.length > 1) {\n const msg = `WebIDL identifier \\`${name}\\` ${\n parent ? `for \\`${parent}\\`` : \"\"\n } is defined multiple times`;\n const title = \"Duplicate definition.\";\n showError(msg, name, { title, elements: dfns });\n }\n if (dfns.length) {\n return dfns[0];\n }\n }\n}\n\n/**\n * @param {HTMLElement} dfnElem\n * @param {*} idlAst\n * @param {string} parent\n * @param {string} name\n */\nexport function decorateDfn(dfnElem, idlAst, parent, name) {\n if (!dfnElem.id) {\n const lCaseParent = parent.toLowerCase();\n const middle = lCaseParent ? `${lCaseParent}-` : \"\";\n let last = name.toLowerCase().replace(/[()]/g, \"\").replace(/\\s/g, \"-\");\n if (last === \"\") {\n last = \"the-empty-string\";\n dfnElem.setAttribute(\"aria-label\", \"the empty string\");\n }\n dfnElem.id = `dom-${middle}${last}`;\n }\n dfnElem.dataset.idl = idlAst.type;\n dfnElem.dataset.title = dfnElem.textContent;\n dfnElem.dataset.dfnFor = parent;\n // Derive the data-type for dictionary members, interface attributes,\n // and methods\n switch (idlAst.type) {\n case \"operation\":\n case \"attribute\":\n case \"field\":\n dfnElem.dataset.type = getDataType(idlAst);\n break;\n }\n\n // Mark the definition as code.\n if (\n !dfnElem.querySelector(\"code\") &&\n !dfnElem.closest(\"code\") &&\n dfnElem.children\n ) {\n wrapInner(dfnElem, dfnElem.ownerDocument.createElement(\"code\"));\n }\n\n // Add data-lt and data-local-lt values and register them\n switch (idlAst.type) {\n case \"attribute\":\n case \"constructor\":\n case \"operation\":\n addAlternativeNames(dfnElem, getAlternativeNames(idlAst, parent, name));\n break;\n }\n\n return dfnElem;\n}\n\n/**\n * @param {string} name\n * @param {string} parent data-dfn-for\n * @param {string} originalName\n * @param {string} type\n */\nfunction getDfns(name, parent, originalName, type) {\n const foundDfns = definitionMap.get(name);\n if (!foundDfns || foundDfns.size === 0) {\n return [];\n }\n const dfnForArray = [...foundDfns];\n // Definitions that have a name and [data-dfn-for] that exactly match the\n // IDL entity:\n const dfns = dfnForArray.filter(dfn => {\n // This is explicitly marked as a concept, so we can't use it\n if (dfn.dataset.dfnType === \"dfn\") return false;\n\n /** @type {HTMLElement} */\n const closestDfnFor = dfn.closest(`[data-dfn-for]`);\n return closestDfnFor && closestDfnFor.dataset.dfnFor === parent;\n });\n\n if (dfns.length === 0 && parent === \"\" && dfnForArray.length === 1) {\n // Make sure the name exactly matches\n return dfnForArray[0].textContent === originalName ? dfnForArray : [];\n } else if (topLevelEntities.has(type) && dfnForArray.length) {\n const dfn = dfnForArray.find(\n dfn => dfn.textContent.trim() === originalName\n );\n if (dfn) return [dfn];\n }\n return dfns;\n}\n\n/**\n * @return {string}\n */\nfunction getDataType(idlStruct = {}) {\n const { idlType, generic, union } = idlStruct;\n if (idlType === undefined) return \"\";\n if (typeof idlType === \"string\") return idlType;\n if (generic) return generic;\n // join on \"|\" handles for \"unsigned short\" etc.\n if (union) return idlType.map(getDataType).join(\"|\");\n return getDataType(idlType);\n}\n","// @ts-check\n/**\n * Module core/webidl-clipboard\n *\n * This module adds a button to each IDL pre making it possible to copy\n * well-formatted IDL to the clipboard.\n *\n */\nexport const name = \"core/webidl-clipboard\";\n\nfunction createButton() {\n const copyButton = document.createElement(\"button\");\n copyButton.innerHTML =\n '<svg height=\"16\" viewBox=\"0 0 14 16\" width=\"14\"><path fill-rule=\"evenodd\" d=\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"/></svg>';\n copyButton.title = \"Copy IDL to clipboard\";\n copyButton.classList.add(\"respec-button-copy-paste\", \"removeOnSave\");\n return copyButton;\n}\n\nconst copyButton = createButton();\n\n/**\n * Adds a HTML button that copies WebIDL to the clipboard.\n *\n * @param {HTMLSpanElement} idlHeader\n */\nexport function addCopyIDLButton(idlHeader) {\n // There may be multiple <span>s of IDL, so we take everything\n // apart from the idl header.\n const pre = idlHeader.closest(\"pre.idl\");\n const idl = pre.cloneNode(true);\n idl.querySelector(\".idlHeader\").remove();\n const { textContent: idlText } = idl;\n const button = copyButton.cloneNode(true);\n button.addEventListener(\"click\", () => {\n navigator.clipboard.writeText(idlText);\n });\n idlHeader.append(button);\n}\n","/* --- WEB IDL --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\npre.idl {\n padding: 1em;\n position: relative;\n}\n\npre.idl > code {\n color: black;\n}\n\n@media print {\n pre.idl {\n white-space: pre-wrap;\n }\n}\n\n.idlHeader {\n display: block;\n width: 150px;\n background: #8ccbf2;\n color: #fff;\n font-family: sans-serif;\n font-weight: bold;\n margin: -1em 0 1em -1em;\n height: 28px;\n line-height: 28px;\n}\n\n.idlHeader a.self-link {\n margin-left: 0.3cm;\n text-decoration: none;\n border-bottom: none;\n}\n\n.idlID {\n font-weight: bold;\n color: #005a9c;\n}\n\n.idlType {\n color: #005a9c;\n}\n\n.idlName {\n color: #ff4500;\n}\n\n.idlName a {\n color: #ff4500;\n border-bottom: 1px dotted #ff4500;\n text-decoration: none;\n}\n\na.idlEnumItem {\n color: #000;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\n.idlSuperclass {\n font-style: italic;\n color: #005a9c;\n}\n\n/*.idlParam*/\n\n.idlParamName,\n.idlDefaultValue {\n font-style: italic;\n}\n\n.extAttr {\n color: #666;\n}\n\n/*.idlSectionComment*/\n\n.idlSectionComment {\n color: gray;\n}\n\n.idlIncludes a {\n font-weight: bold;\n}\n\n.respec-button-copy-paste:focus {\n text-decoration: none;\n border-color: #51a7e8;\n outline: none;\n box-shadow: 0 0 5px rgba(81, 167, 232, 0.5);\n}\n\n.respec-button-copy-paste:is(:focus:hover,.selected:focus) {\n border-color: #51a7e8;\n}\n\n.respec-button-copy-paste:is(:hover,:active,.zeroclipboard-is-hover,.zeroclipboard-is-active) {\n text-decoration: none;\n background-color: #ddd;\n background-image: linear-gradient(#eee, #ddd);\n border-color: #ccc;\n}\n\n.respec-button-copy-paste:is(:active,.selected,.zeroclipboard-is-active) {\n background-color: #dcdcdc;\n background-image: none;\n border-color: #b5b5b5;\n box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);\n}\n\n.respec-button-copy-paste.selected:hover {\n background-color: #cfcfcf;\n}\n\n.respec-button-copy-paste:is(:disabled,:disabled:hover,.disabled,.disabled:hover) {\n color: rgba(102, 102, 102, 0.5);\n cursor: default;\n background-color: rgba(229, 229, 229, 0.5);\n background-image: none;\n border-color: rgba(197, 197, 197, 0.5);\n box-shadow: none;\n}\n\n@media print {\n .respec-button-copy-paste {\n visibility: hidden;\n }\n}\n`;\n","// Module core/webidl\n// Highlights and links WebIDL marked up inside <pre class=\"idl\">.\n\n// TODO:\n// - It could be useful to report parsed IDL items as events\n// - don't use generated content in the CSS!\nimport {\n addHashId,\n docLink,\n showError,\n showWarning,\n wrapInner,\n xmlEscape,\n} from \"./utils.js\";\nimport { decorateDfn, findDfn } from \"./dfn-finder.js\";\nimport { html, webidl2 } from \"./import-maps.js\";\nimport { addCopyIDLButton } from \"./webidl-clipboard.js\";\nimport css from \"../styles/webidl.css.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/webidl\";\nconst pluginName = name;\n\nconst operationNames = {};\nconst idlPartials = {};\n\nconst templates = {\n wrap(items) {\n return items\n .flat()\n .filter(x => x !== \"\")\n .map(x => (typeof x === \"string\" ? new Text(x) : x));\n },\n trivia(t) {\n if (!t.trim()) {\n return t;\n }\n return html`<span class=\"idlSectionComment\">${t}</span>`;\n },\n generic(keyword) {\n // Shepherd classifies \"interfaces\" as starting with capital letters,\n // like Promise, FrozenArray, etc.\n return /^[A-Z]/.test(keyword)\n ? html`<a data-xref-type=\"interface\" data-cite=\"WEBIDL\">${keyword}</a>`\n : // Other keywords like sequence, maplike, etc...\n html`<a data-xref-type=\"dfn\" data-cite=\"WEBIDL\">${keyword}</a>`;\n },\n reference(wrapped, unescaped, context) {\n if (context.type === \"extended-attribute\") {\n return wrapped;\n }\n let type = \"_IDL_\";\n let cite = null;\n let lt;\n switch (unescaped) {\n case \"object\":\n type = \"interface\";\n cite = \"WEBIDL\";\n break;\n }\n return html`<a\n data-link-type=\"${type === \"_IDL_\" ? \"idl\" : type}\"\n data-xref-type=\"${type}\"\n data-cite=\"${cite}\"\n data-lt=\"${lt}\"\n >${wrapped}</a\n >`;\n },\n name(escaped, { data, parent }) {\n if (data.idlType && data.idlType.type === \"argument-type\") {\n return html`<span class=\"idlParamName\">${escaped}</span>`;\n }\n const idlLink = defineIdlName(escaped, data, parent);\n if (data.type !== \"enum-value\") {\n const className = parent ? \"idlName\" : \"idlID\";\n idlLink.classList.add(className);\n }\n return idlLink;\n },\n nameless(escaped, { data, parent }) {\n switch (data.type) {\n case \"operation\":\n case \"constructor\":\n return defineIdlName(escaped, data, parent);\n default:\n return escaped;\n }\n },\n type(contents) {\n return html`<span class=\"idlType\">${contents}</span>`;\n },\n inheritance(contents) {\n return html`<span class=\"idlSuperclass\">${contents}</span>`;\n },\n definition(contents, { data, parent }) {\n const className = getIdlDefinitionClassName(data);\n switch (data.type) {\n case \"includes\":\n case \"enum-value\":\n return html`<span class=\"${className}\">${contents}</span>`;\n }\n const parentName = parent ? parent.name : \"\";\n const { name, idlId } = getNameAndId(data, parentName);\n return html`<span\n class=\"${className}\"\n id=\"${idlId}\"\n data-idl\n data-title=\"${name}\"\n >${contents}</span\n >`;\n },\n extendedAttribute(contents) {\n const result = html`<span class=\"extAttr\">${contents}</span>`;\n return result;\n },\n extendedAttributeReference(name) {\n return html`<a data-xref-type=\"extended-attribute\">${name}</a>`;\n },\n};\n\n/**\n * Returns a link to existing <dfn> or creates one if doesn’t exists.\n */\nfunction defineIdlName(escaped, data, parent) {\n const parentName = parent ? parent.name : \"\";\n const { name } = getNameAndId(data, parentName);\n const dfn = findDfn(data, name, {\n parent: parentName,\n });\n const linkType = getDfnType(data.type);\n if (dfn) {\n if (!data.partial) {\n if (!dfn.matches(\"[data-noexport]\")) dfn.dataset.export = \"\";\n dfn.dataset.dfnType = linkType;\n }\n decorateDfn(dfn, data, parentName, name);\n const href = `#${dfn.id}`;\n return html`<a\n data-link-for=\"${parentName}\"\n data-link-type=\"${linkType}\"\n href=\"${href}\"\n class=\"internalDFN\"\n ><code>${escaped}</code></a\n >`;\n }\n\n const isDefaultJSON =\n data.type === \"operation\" &&\n data.name === \"toJSON\" &&\n data.extAttrs.some(({ name }) => name === \"Default\");\n if (isDefaultJSON) {\n return html`<a data-link-type=\"dfn\" data-lt=\"default toJSON steps\"\n >${escaped}</a\n >`;\n }\n if (!data.partial) {\n const dfn = html`<dfn data-export data-dfn-type=\"${linkType}\"\n >${escaped}</dfn\n >`;\n registerDefinition(dfn, [name]);\n decorateDfn(dfn, data, parentName, name);\n return dfn;\n }\n\n const unlinkedAnchor = html`<a\n data-idl=\"${data.partial ? \"partial\" : null}\"\n data-link-type=\"${linkType}\"\n data-title=\"${data.name}\"\n data-xref-type=\"${linkType}\"\n >${escaped}</a\n >`;\n\n const showWarnings =\n name && data.type !== \"typedef\" && !(data.partial && !dfn);\n if (showWarnings) {\n const styledName = data.type === \"operation\" ? `${name}()` : name;\n const ofParent = parentName ? ` \\`${parentName}\\`'s` : \"\";\n const msg = `Missing \\`<dfn>\\` for${ofParent} \\`${styledName}\\` ${data.type}.`;\n const hint = docLink`See ${\"using `data-dfn-for`|#data-dfn-for\"} in ReSpec's documentation.`;\n showWarning(msg, pluginName, { elements: [unlinkedAnchor], hint });\n }\n return unlinkedAnchor;\n}\n\n/**\n * Map to Shepherd types, for export.\n * @see https://tabatkins.github.io/bikeshed/#dfn-types\n */\nfunction getDfnType(idlType) {\n switch (idlType) {\n case \"operation\":\n return \"method\";\n case \"field\":\n return \"dict-member\";\n case \"callback interface\":\n case \"interface mixin\":\n return \"interface\";\n default:\n return idlType;\n }\n}\n\nfunction getIdlDefinitionClassName(defn) {\n switch (defn.type) {\n case \"callback interface\":\n return \"idlInterface\";\n case \"operation\":\n return \"idlMethod\";\n case \"field\":\n return \"idlMember\";\n case \"enum-value\":\n return \"idlEnumItem\";\n case \"callback function\":\n return \"idlCallback\";\n }\n return `idl${defn.type[0].toUpperCase()}${defn.type.slice(1)}`;\n}\n\nconst nameResolverMap = new WeakMap();\nfunction getNameAndId(defn, parent = \"\") {\n if (nameResolverMap.has(defn)) {\n return nameResolverMap.get(defn);\n }\n const result = resolveNameAndId(defn, parent);\n nameResolverMap.set(defn, result);\n return result;\n}\n\nfunction resolveNameAndId(defn, parent) {\n let name = getDefnName(defn);\n // For getters, setters, etc. \"anonymous-getter\",\n const prefix = defn.special && defn.name === \"\" ? \"anonymous-\" : \"\";\n let idlId = getIdlId(prefix + name, parent);\n switch (defn.type) {\n // Top-level entities with linkable members.\n case \"callback interface\":\n case \"dictionary\":\n case \"interface\":\n case \"interface mixin\": {\n idlId += resolvePartial(defn);\n break;\n }\n case \"constructor\":\n case \"operation\": {\n const overload = resolveOverload(name, parent);\n if (overload) {\n name += overload;\n idlId += overload;\n } else if (defn.arguments.length) {\n idlId += defn.arguments\n .map(arg => `-${arg.name.toLowerCase()}`)\n .join(\"\");\n }\n break;\n }\n }\n return { name, idlId };\n}\n\nfunction resolvePartial(defn) {\n if (!defn.partial) {\n return \"\";\n }\n if (!idlPartials[defn.name]) {\n idlPartials[defn.name] = 0;\n }\n idlPartials[defn.name] += 1;\n return `-partial-${idlPartials[defn.name]}`;\n}\n\nfunction resolveOverload(name, parentName) {\n const qualifiedName = `${parentName}.${name}`;\n const fullyQualifiedName = `${qualifiedName}()`;\n let overload;\n if (!operationNames[fullyQualifiedName]) {\n operationNames[fullyQualifiedName] = 0;\n }\n if (!operationNames[qualifiedName]) {\n operationNames[qualifiedName] = 0;\n } else {\n overload = `!overload-${operationNames[qualifiedName]}`;\n }\n operationNames[fullyQualifiedName] += 1;\n operationNames[qualifiedName] += 1;\n return overload || \"\";\n}\n\nfunction getIdlId(name, parentName) {\n if (!parentName) {\n return `idl-def-${name.toLowerCase()}`;\n }\n return `idl-def-${parentName.toLowerCase()}-${name.toLowerCase()}`;\n}\n\nfunction getDefnName(defn) {\n switch (defn.type) {\n case \"enum-value\":\n return defn.value;\n case \"operation\":\n return defn.name || defn.special;\n default:\n return defn.name || defn.type;\n }\n}\n\n// IDL types that never need a data-dfn-for\nconst topLevelIdlTypes = [\n \"interface\",\n \"interface mixin\",\n \"dictionary\",\n \"namespace\",\n \"enum\",\n \"typedef\",\n \"callback\",\n];\n\n/**\n * @param {Element} idlElement\n * @param {number} index\n */\nfunction renderWebIDL(idlElement, index) {\n let parse;\n try {\n parse = webidl2.parse(idlElement.textContent, {\n sourceName: String(index),\n });\n } catch (e) {\n const msg = `Failed to parse WebIDL: ${e.bareMessage}.`;\n showError(msg, pluginName, {\n title: e.bareMessage,\n details: `<pre>${e.context}</pre>`,\n elements: [idlElement],\n });\n // Skip this <pre> and move on to the next one.\n return [];\n }\n // we add \"idl\" as the canonical match, so both \"webidl\" and \"idl\" work\n idlElement.classList.add(\"def\", \"idl\");\n const highlights = webidl2.write(parse, { templates });\n html.bind(idlElement)`${highlights}`;\n wrapInner(idlElement, document.createElement(\"code\"));\n idlElement.querySelectorAll(\"[data-idl]\").forEach(elem => {\n if (elem.dataset.dfnFor) {\n return;\n }\n const title = elem.dataset.title;\n // Select the nearest ancestor element that can contain members.\n const idlType = elem.dataset.dfnType;\n\n const parent = elem.parentElement.closest(\"[data-idl][data-title]\");\n if (parent && !topLevelIdlTypes.includes(idlType)) {\n elem.dataset.dfnFor = parent.dataset.title;\n }\n if (elem.localName === \"dfn\") {\n registerDefinition(elem, [title]);\n }\n });\n // cross reference\n const closestCite = idlElement.closest(\"[data-cite], body\");\n const { dataset } = closestCite;\n if (!dataset.cite) dataset.cite = \"WEBIDL\";\n // includes webidl in some form\n if (!/\\bwebidl\\b/i.test(dataset.cite)) {\n const cites = dataset.cite.trim().split(/\\s+/);\n dataset.cite = [\"WEBIDL\", ...cites].join(\" \");\n }\n addIDLHeader(idlElement);\n return parse;\n}\n/**\n * Adds a \"WebIDL\" decorative header/permalink to a block of WebIDL.\n * @param {HTMLPreElement} pre\n */\nexport function addIDLHeader(pre) {\n addHashId(pre, \"webidl\");\n const header = html`<span class=\"idlHeader\"\n ><a class=\"self-link\" href=\"${`#${pre.id}`}\">WebIDL</a></span\n >`;\n pre.prepend(header);\n addCopyIDLButton(header);\n}\n\nexport async function run() {\n const idls = document.querySelectorAll(\"pre.idl, pre.webidl\");\n if (!idls.length) {\n return;\n }\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.querySelector(\"head link, head > *:last-child\").before(style);\n\n const astArray = [...idls].map(renderWebIDL);\n\n const validations = webidl2.validate(astArray);\n for (const validation of validations) {\n let details = `<pre>${xmlEscape(validation.context)}</pre>`;\n if (validation.autofix) {\n validation.autofix();\n const idlToFix = webidl2.write(astArray[validation.sourceName]);\n const escaped = xmlEscape(idlToFix);\n details += `Try fixing as:\n <pre>${escaped}</pre>`;\n }\n const msg = `WebIDL validation error: ${validation.bareMessage}`;\n showError(msg, pluginName, {\n details,\n elements: [idls[validation.sourceName]],\n title: validation.bareMessage,\n });\n }\n document.normalize();\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n */\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/w3c/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting an linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as fragment\n return toCiteDetails(elem);\n }\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' の重複定義`;\n },\n duplicateTitle: \"この文書内で複数回定義されています.\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthält mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' 的重复定义`;\n },\n duplicateTitle: \"在文档中有重复的定义。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n return dfnsByType.get(linkType) || dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\nimport { API_URL } from \"./xref.js\";\nimport { idb } from \"./import-maps.js\";\n\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {import('core/xref').XrefDatabase} XrefDatabase\n */\n\nconst STORE_NAME = \"xrefs\";\nconst VERSION_CHECK_WAIT = 5 * 60 * 1000; // 5 min\n\nasync function getIdbCache() {\n /** @type {XrefDatabase} */\n const db = await idb.openDB(\"xref\", 2, {\n upgrade(db) {\n [...db.objectStoreNames].forEach(s => db.deleteObjectStore(s));\n const store = db.createObjectStore(STORE_NAME, { keyPath: \"query.id\" });\n store.createIndex(\"byTerm\", \"query.term\", { unique: false });\n },\n });\n return db;\n}\n\n/** @param {RequestEntry[]} queries */\nexport async function resolveXrefCache(queries) {\n /** @type {Map<string, SearchResultEntry[]>} */\n const cachedData = new Map();\n\n const bustCache = await shouldBustCache();\n if (bustCache) {\n await clearXrefData();\n return cachedData;\n }\n\n const requiredKeySet = new Set(queries.map(query => query.id));\n try {\n const cache = await getIdbCache();\n let cursor = await cache.transaction(STORE_NAME).store.openCursor();\n while (cursor) {\n if (requiredKeySet.has(cursor.key)) {\n cachedData.set(cursor.key, cursor.value.result);\n }\n cursor = await cursor.continue();\n }\n } catch (err) {\n console.error(err);\n }\n return cachedData;\n}\n\n/**\n * Get last updated timestamp from server and bust cache based on that. This\n * way, we prevent dirty/erroneous/stale data being kept on a client (which is\n * possible if we use a `MAX_AGE` based caching strategy).\n */\nasync function shouldBustCache() {\n const key = \"XREF:LAST_VERSION_CHECK\";\n const lastChecked = parseInt(localStorage.getItem(key), 10);\n const now = Date.now();\n\n if (!lastChecked) {\n localStorage.setItem(key, now.toString());\n return false;\n }\n if (now - lastChecked < VERSION_CHECK_WAIT) {\n // avoid checking network for any data update if old cache \"fresh\"\n return false;\n }\n\n const url = new URL(\"meta/version\", API_URL).href;\n const res = await fetch(url);\n if (!res.ok) return false;\n const lastUpdated = await res.text();\n localStorage.setItem(key, now.toString());\n return parseInt(lastUpdated, 10) > lastChecked;\n}\n\n/**\n * @param {RequestEntry[]} queries\n * @param {Map<string, SearchResultEntry[]>} results\n */\nexport async function cacheXrefData(queries, results) {\n try {\n const cache = await getIdbCache();\n const tx = cache.transaction(STORE_NAME, \"readwrite\");\n for (const query of queries) {\n const result = results.get(query.id);\n tx.objectStore(STORE_NAME).add({ query, result });\n }\n await tx.done;\n } catch (e) {\n console.error(e);\n }\n}\n\nexport async function clearXrefData() {\n try {\n await getIdbCache().then(db => db.clear(STORE_NAME));\n } catch (e) {\n console.error(e);\n }\n}\n","// @ts-check\n/**\n * @module core/xref\n *\n * Automatically adds external references.\n *\n * Searches for the terms which do not have a local definition at xref API and\n * for each query, adds `data-cite` attributes to respective elements.\n * `core/data-cite` later converts these data-cite attributes to actual links.\n * https://github.com/w3c/respec/issues/1662\n */\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {Map<string, { elems: HTMLElement[], results: SearchResultEntry[], query: RequestEntry }>} ErrorCollection\n * @typedef {{ ambiguous: ErrorCollection, notFound: ErrorCollection }} Errors\n */\nimport { cacheXrefData, resolveXrefCache } from \"./xref-db.js\";\nimport {\n createResourceHint,\n docLink,\n joinAnd,\n joinOr,\n nonNormativeSelector,\n norm as normalize,\n showError,\n} from \"./utils.js\";\nimport { possibleExternalLinks } from \"./link-to-dfn.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/xref\";\n\nconst profiles = {\n \"web-platform\": [\"HTML\", \"INFRA\", \"URL\", \"WEBIDL\", \"DOM\", \"FETCH\"],\n};\n\nexport const API_URL = \"https://respec.org/xref/\";\n\n/** @type {{ term: string; spec: string; element: HTMLElement }[]} */\nexport const informativeRefsInNormative = [];\n\nif (\n !document.querySelector(\"link[rel='preconnect'][href='https://respec.org']\")\n) {\n const link = createResourceHint({\n hint: \"preconnect\",\n href: \"https://respec.org\",\n });\n document.head.appendChild(link);\n}\n\n/**\n * @param {Object} conf respecConfig\n */\nexport async function run(conf) {\n if (!conf.xref) {\n return;\n }\n\n const xref = normalizeConfig(conf.xref);\n if (xref.specs) {\n const bodyCite = document.body.dataset.cite\n ? document.body.dataset.cite.split(/\\s+/)\n : [];\n document.body.dataset.cite = bodyCite.concat(xref.specs).join(\" \");\n }\n\n const elems = possibleExternalLinks.concat(findExplicitExternalLinks());\n if (!elems.length) return;\n\n /** @type {RequestEntry[]} */\n const queryKeys = [];\n for (const elem of elems) {\n const entry = getRequestEntry(elem);\n entry.id = await objectHash(entry);\n queryKeys.push(entry);\n }\n\n const data = await getData(queryKeys, xref.url);\n addDataCiteToTerms(elems, queryKeys, data, conf);\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Find additional references that need to be looked up externally.\n * Examples: a[data-cite=\"spec\"], dfn[data-cite=\"spec\"], dfn.externalDFN\n */\nfunction findExplicitExternalLinks() {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n \":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])\"\n );\n /** @type {NodeListOf<HTMLElement>} */\n const externalDFNs = document.querySelectorAll(\"dfn.externalDFN\");\n return [...links]\n .filter(el => {\n // ignore empties\n if (el.textContent.trim() === \"\") return false;\n /** @type {HTMLElement} */\n const closest = el.closest(\"[data-cite]\");\n return !closest || closest.dataset.cite !== \"\";\n })\n .concat(...externalDFNs);\n}\n\n/**\n * converts conf.xref to object with url and spec properties\n */\nfunction normalizeConfig(xref) {\n const defaults = {\n url: API_URL,\n specs: null,\n };\n\n const config = Object.assign({}, defaults);\n\n const type = Array.isArray(xref) ? \"array\" : typeof xref;\n switch (type) {\n case \"boolean\":\n // using defaults already, as above\n break;\n case \"string\":\n if (xref.toLowerCase() in profiles) {\n Object.assign(config, { specs: profiles[xref.toLowerCase()] });\n } else {\n invalidProfileError(xref);\n }\n break;\n case \"array\":\n Object.assign(config, { specs: xref });\n break;\n case \"object\":\n Object.assign(config, xref);\n if (xref.profile) {\n const profile = xref.profile.toLowerCase();\n if (profile in profiles) {\n const specs = (xref.specs ?? []).concat(profiles[profile]);\n Object.assign(config, { specs });\n } else {\n invalidProfileError(xref.profile);\n }\n }\n break;\n default: {\n const msg = `Invalid value for \\`xref\\` configuration option. Received: \"${xref}\".`;\n showError(msg, name);\n }\n }\n return config;\n\n function invalidProfileError(profile) {\n const supportedProfiles = joinOr(Object.keys(profiles), s => `\"${s}\"`);\n const msg =\n `Invalid profile \"${profile}\" in \\`respecConfig.xref\\`. ` +\n `Please use one of the supported profiles: ${supportedProfiles}.`;\n showError(msg, name);\n }\n}\n\n/**\n * get xref API request entry (term and context) for given xref element\n * @param {HTMLElement} elem\n */\nfunction getRequestEntry(elem) {\n const isIDL = \"xrefType\" in elem.dataset;\n\n let term = getTermFromElement(elem);\n if (!isIDL) term = term.toLowerCase();\n\n const specs = getSpecContext(elem);\n const types = getTypeContext(elem, isIDL);\n const forContext = getForContext(elem, isIDL);\n\n return {\n // Add an empty `id` to ensure the shape of object returned stays same when\n // actual `id` is added later (minor perf optimization, also makes\n // TypeScript happy).\n id: \"\",\n term,\n types,\n ...(specs.length && { specs }),\n ...(typeof forContext === \"string\" && { for: forContext }),\n };\n}\n\n/** @param {HTMLElement} elem */\nexport function getTermFromElement(elem) {\n const { lt: linkingText } = elem.dataset;\n let term = linkingText ? linkingText.split(\"|\", 1)[0] : elem.textContent;\n term = normalize(term);\n return term === \"the-empty-string\" ? \"\" : term;\n}\n\n/**\n * Get spec context as a fallback chain, where each level (sub-array) represents\n * decreasing priority.\n * @param {HTMLElement} elem\n */\nfunction getSpecContext(elem) {\n /** @type {string[][]} */\n const specs = [];\n\n /** @type {HTMLElement} */\n let dataciteElem = elem.closest(\"[data-cite]\");\n\n // Traverse up towards the root element, adding levels of lower priority specs\n while (dataciteElem) {\n const cite = dataciteElem.dataset.cite.toLowerCase().replace(/[!?]/g, \"\");\n const cites = cite.split(/\\s+/).filter(s => s);\n if (cites.length) {\n specs.push(cites);\n }\n if (dataciteElem === elem) break;\n dataciteElem = dataciteElem.parentElement.closest(\"[data-cite]\");\n }\n\n // If element itself contains data-cite, we don't take inline context into\n // account. The inline bibref context has lowest priority, if available.\n if (dataciteElem !== elem) {\n const closestSection = elem.closest(\"section\");\n /** @type {Iterable<HTMLElement>} */\n const bibrefs = closestSection\n ? closestSection.querySelectorAll(\"a.bibref\")\n : [];\n const inlineRefs = [...bibrefs].map(el => el.textContent.toLowerCase());\n if (inlineRefs.length) {\n specs.push(inlineRefs);\n }\n }\n\n const uniqueSpecContext = dedupeSpecContext(specs);\n return uniqueSpecContext;\n}\n\n/**\n * If we already have a spec in a higher priority level (closer to element) of\n * fallback chain, skip it from low priority levels, to prevent duplication.\n * @param {string[][]} specs\n * */\nfunction dedupeSpecContext(specs) {\n /** @type {string[][]} */\n const unique = [];\n for (const level of specs) {\n const higherPriority = unique[unique.length - 1] || [];\n const uniqueSpecs = [...new Set(level)].filter(\n spec => !higherPriority.includes(spec)\n );\n unique.push(uniqueSpecs.sort());\n }\n return unique;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getForContext(elem, isIDL) {\n if (elem.dataset.xrefFor) {\n return normalize(elem.dataset.xrefFor);\n }\n\n if (isIDL) {\n /** @type {HTMLElement} */\n const dataXrefForElem = elem.closest(\"[data-xref-for]\");\n if (dataXrefForElem) {\n return normalize(dataXrefForElem.dataset.xrefFor);\n }\n }\n\n return null;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getTypeContext(elem, isIDL) {\n if (isIDL) {\n if (elem.dataset.xrefType) {\n return elem.dataset.xrefType.split(\"|\");\n }\n return [\"_IDL_\"];\n }\n\n return [\"_CONCEPT_\"];\n}\n\n/**\n * @param {RequestEntry[]} queryKeys\n * @param {string} apiUrl\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function getData(queryKeys, apiUrl) {\n const uniqueIds = new Set();\n const uniqueQueryKeys = queryKeys.filter(key => {\n return uniqueIds.has(key.id) ? false : uniqueIds.add(key.id) && true;\n });\n\n const resultsFromCache = await resolveXrefCache(uniqueQueryKeys);\n\n const termsToLook = uniqueQueryKeys.filter(\n key => !resultsFromCache.get(key.id)\n );\n const fetchedResults = await fetchFromNetwork(termsToLook, apiUrl);\n if (fetchedResults.size) {\n // add data to cache\n await cacheXrefData(uniqueQueryKeys, fetchedResults);\n }\n\n return new Map([...resultsFromCache, ...fetchedResults]);\n}\n\n/**\n * @param {RequestEntry[]} keys\n * @param {string} url\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function fetchFromNetwork(keys, url) {\n if (!keys.length) return new Map();\n\n const query = { keys };\n const options = {\n method: \"POST\",\n body: JSON.stringify(query),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n const response = await fetch(url, options);\n const json = await response.json();\n return new Map(json.result);\n}\n\n/**\n * Figures out from the tree structure if the reference is\n * normative (true) or informative (false).\n * @param {HTMLElement} elem\n */\nfunction isNormative(elem) {\n const closestNormative = elem.closest(\".normative\");\n const closestInform = elem.closest(nonNormativeSelector);\n if (!closestInform || elem === closestNormative) {\n return true;\n }\n return (\n closestNormative &&\n closestInform &&\n closestInform.contains(closestNormative)\n );\n}\n\n/**\n * adds data-cite attributes to elems for each term for which results are found.\n * adds citations to references section.\n * collects and shows linking errors if any.\n * @param {HTMLElement[]} elems\n * @param {RequestEntry[]} queryKeys\n * @param {Map<string, SearchResultEntry[]>} data\n * @param {any} conf\n */\nfunction addDataCiteToTerms(elems, queryKeys, data, conf) {\n /** @type {Errors} */\n const errors = { ambiguous: new Map(), notFound: new Map() };\n\n for (let i = 0, l = elems.length; i < l; i++) {\n if (elems[i].closest(\"[data-no-xref]\")) continue;\n\n const elem = elems[i];\n const query = queryKeys[i];\n\n const { id } = query;\n const results = data.get(id);\n if (results.length === 1) {\n addDataCite(elem, query, results[0], conf);\n } else {\n const collector = errors[results.length === 0 ? \"notFound\" : \"ambiguous\"];\n if (!collector.has(id)) {\n collector.set(id, { elems: [], results, query });\n }\n collector.get(id).elems.push(elem);\n }\n }\n\n showErrors(errors);\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {RequestEntry} query\n * @param {SearchResultEntry} result\n * @param {any} conf\n */\nfunction addDataCite(elem, query, result, conf) {\n const { term, specs = [] } = query;\n const { uri, shortname, spec, normative, type, for: forContext } = result;\n // if authored spec context had `result.spec`, use it instead of shortname\n const cite = specs.flat().includes(spec) ? spec : shortname;\n // we use this \"partial\" URL to resolve parts of urls...\n // but sometimes we get lucky and we get an absolute URL from xref\n // which we can then use in other places (e.g., data-cite.js)\n const url = new URL(uri, \"https://partial\");\n const { pathname: citePath } = url;\n const citeFrag = url.hash.slice(1);\n const dataset = { cite, citePath, citeFrag, type };\n if (forContext) dataset.linkFor = forContext[0];\n if (url.origin && url.origin !== \"https://partial\") {\n dataset.citeHref = url.href;\n }\n Object.assign(elem.dataset, dataset);\n\n addToReferences(elem, cite, normative, term, conf);\n}\n\n/**\n * add specs for citation (references section)\n * @param {HTMLElement} elem\n * @param {string} cite\n * @param {boolean} normative\n * @param {string} term\n * @param {any} conf\n */\nfunction addToReferences(elem, cite, normative, term, conf) {\n const isNormRef = isNormative(elem);\n if (!isNormRef) {\n // Only add it if not already normative...\n if (!conf.normativeReferences.has(cite)) {\n conf.informativeReferences.add(cite);\n }\n return;\n }\n if (normative) {\n // If it was originally informative, we move the existing\n // key to be normative.\n const existingKey = conf.informativeReferences.has(cite)\n ? conf.informativeReferences.getCanonicalKey(cite)\n : cite;\n conf.normativeReferences.add(existingKey);\n conf.informativeReferences.delete(existingKey);\n return;\n }\n\n // This is used by the informative-dfn linter\n informativeRefsInNormative.push({ term, spec: cite, element: elem });\n}\n\n/** @param {Errors} errors */\nfunction showErrors({ ambiguous, notFound }) {\n const getPrefilledFormURL = (term, query, specs = []) => {\n const url = new URL(API_URL);\n url.searchParams.set(\"term\", term);\n if (query.for) url.searchParams.set(\"for\", query.for);\n url.searchParams.set(\"types\", query.types.join(\",\"));\n if (specs.length) url.searchParams.set(\"specs\", specs.join(\",\"));\n return url.href;\n };\n\n const howToFix = (howToCiteURL, originalTerm) => {\n return docLink`[See search matches for \"${originalTerm}\"](${howToCiteURL}) or ${\"[Learn about this error|#error-term-not-found]\"}.`;\n };\n\n for (const { query, elems } of notFound.values()) {\n const specs = query.specs ? [...new Set(query.specs.flat())].sort() : [];\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query);\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const hint = howToFix(formUrl, originalTerm);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const msg = `Couldn't find \"**${originalTerm}**\"${forParent} in this document or other cited documents: ${specsString}.`;\n const title = \"No matching definition found.\";\n showError(msg, name, { title, elements: elems, hint });\n }\n\n for (const { query, elems, results } of ambiguous.values()) {\n const specs = [...new Set(results.map(entry => entry.shortname))].sort();\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const moreInfo = howToFix(formUrl, originalTerm);\n const hint = docLink`To fix, use the ${\"[data-cite]\"} attribute to pick the one you mean from the appropriate specification. ${moreInfo}.`;\n const msg = `The term \"**${originalTerm}**\"${forParent} is ambiguous because it's defined in ${specsString}.`;\n const title = \"Definition is ambiguous.\";\n showError(msg, name, { title, elements: elems, hint });\n }\n}\n\nfunction objectHash(obj) {\n const str = JSON.stringify(obj, Object.keys(obj).sort());\n const buffer = new TextEncoder().encode(str);\n return crypto.subtle.digest(\"SHA-1\", buffer).then(bufferToHexString);\n}\n\n/** @param {ArrayBuffer} buffer */\nfunction bufferToHexString(buffer) {\n const byteArray = new Uint8Array(buffer);\n return [...byteArray].map(v => v.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction cleanup(doc) {\n const elems = doc.querySelectorAll(\n \"a[data-xref-for], a[data-xref-type], a[data-link-for]\"\n );\n const attrToRemove = [\"data-xref-for\", \"data-xref-type\", \"data-link-for\"];\n elems.forEach(el => {\n attrToRemove.forEach(attr => el.removeAttribute(attr));\n });\n}\n","/*\n@module \"core/dfn-index\"\nExtends and overrides some styles from `base.css`.\n*/\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nul.index {\n columns: 30ch;\n column-gap: 1.5em;\n}\n\nul.index li {\n list-style: inherit;\n}\n\nul.index li span {\n color: inherit;\n cursor: pointer;\n white-space: normal;\n}\n\n#index-defined-here ul.index li {\n font-size: 0.9rem;\n}\n\nul.index code {\n color: inherit;\n}\n\n#index-defined-here .print-only {\n display: none;\n}\n\n@media print {\n #index-defined-here .print-only {\n display: initial;\n }\n}\n`;\n","// @ts-check\n/**\n * If a `<section id=\"index\">` exists, it is filled by a list of terms defined\n * (locally) by current document and a list of terms referenced (external) by\n * current document.\n */\n\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport css from \"../styles/dfn-index.css.js\";\nimport { getTermFromElement } from \"./xref.js\";\nimport { html } from \"./import-maps.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\nimport { sub } from \"./pubsubhub.js\";\nimport { toCiteDetails } from \"./data-cite.js\";\n\nexport const name = \"core/dfn-index\";\n\nconst localizationStrings = {\n en: {\n heading: \"Index\",\n headingExternal: \"Terms defined by reference\",\n headlingLocal: \"Terms defined by this specification\",\n dfnOf: \"definition of\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Terms of these _types_ are wrapped in `<code>`.\nconst CODE_TYPES = new Set([\n \"attribute\",\n \"callback\",\n \"dict-member\",\n \"dictionary\",\n \"element-attr\",\n \"element\",\n \"enum-value\",\n \"enum\",\n \"exception\",\n \"extended-attribute\",\n \"interface\",\n \"method\",\n \"typedef\",\n]);\n\n/**\n * @typedef {{ term: string, type: string, linkFor: string, elem: HTMLAnchorElement }} Entry\n */\n\nexport function run() {\n const index = document.querySelector(\"section#index\");\n if (!index) {\n // See below...\n sub(\"toc\", () => {}, { once: true });\n return;\n }\n\n const styleEl = document.createElement(\"style\");\n styleEl.textContent = css;\n document.head.appendChild(styleEl);\n\n index.classList.add(\"appendix\");\n if (!index.querySelector(\"h2, h1\")) {\n index.prepend(html`<h1>${l10n.heading}</h1>`);\n }\n\n const localTermIndex = html`<section id=\"index-defined-here\">\n <h3>${l10n.headlingLocal}</h3>\n ${createLocalTermIndex()}\n </section>`;\n index.append(localTermIndex);\n\n const externalTermIndex = html`<section id=\"index-defined-elsewhere\">\n <h3>${l10n.headingExternal}</h3>\n ${createExternalTermIndex()}\n </section>`;\n index.append(externalTermIndex);\n for (const el of externalTermIndex.querySelectorAll(\".index-term\")) {\n addId(el, \"index-term\");\n }\n\n // XXX: This event is used to overcome an edge case with core/structure,\n // related to a circular dependency in plugin run order. We want\n // core/structure to run after dfn-index so the #index can be listed in the\n // TOC, but we also want section numbers in dfn-index. So, we \"split\"\n // core/dfn-index in two parts, one that runs before core/structure (using\n // plugin order in profile) and the other (following) after section numbers\n // are generated in core/structure (this event).\n sub(\"toc\", appendSectionNumbers, { once: true });\n\n sub(\"beforesave\", cleanup);\n}\n\nfunction createLocalTermIndex() {\n const dataSortedByTerm = collectLocalTerms();\n return html`<ul class=\"index\">\n ${dataSortedByTerm.map(([term, dfns]) => renderLocalTerm(term, dfns))}\n </ul>`;\n}\n\nfunction collectLocalTerms() {\n /** @type {Map<string, HTMLElement[]>} */\n const data = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"dfn:not([data-cite])\");\n for (const elem of elems) {\n if (!elem.id) continue;\n const text = norm(elem.textContent);\n const elemsByTerm = data.get(text) || data.set(text, []).get(text);\n elemsByTerm.push(elem);\n }\n\n const dataSortedByTerm = [...data].sort(([a], [b]) =>\n a.slice(a.search(/\\w/)).localeCompare(b.slice(b.search(/\\w/)))\n );\n\n return dataSortedByTerm;\n}\n\n/**\n * @param {string} term\n * @param {HTMLElement[]} dfns\n * @returns {HTMLLIElement}\n */\nfunction renderLocalTerm(term, dfns) {\n const renderItem = (dfn, text, suffix) => {\n const href = `#${dfn.id}`;\n return html`<li data-id=${dfn.id}>\n <a class=\"index-term\" href=\"${href}\">${{ html: text }}</a> ${suffix\n ? { html: suffix }\n : \"\"}\n </li>`;\n };\n\n if (dfns.length === 1) {\n const dfn = dfns[0];\n const type = getLocalTermType(dfn);\n const text = getLocalTermText(dfn, type, term);\n const suffix = getLocalTermSuffix(dfn, type, term);\n return renderItem(dfn, text, suffix);\n }\n return html`<li>\n ${term}\n <ul>\n ${dfns.map(dfn => {\n const type = getLocalTermType(dfn);\n const text = getLocalTermSuffix(dfn, type, term) || l10n.dfnOf;\n return renderItem(dfn, text);\n })}\n </ul>\n </li>`;\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermType(dfn) {\n const ds = dfn.dataset;\n const type = ds.dfnType || ds.idl || ds.linkType || \"\";\n switch (type) {\n case \"\":\n case \"dfn\":\n return \"\";\n default:\n return type;\n }\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermParentContext(dfn) {\n /** @type {HTMLElement} */\n const dfnFor = dfn.closest(\"[data-dfn-for]:not([data-dfn-for=''])\");\n return dfnFor ? dfnFor.dataset.dfnFor : \"\";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} term\n */\nfunction getLocalTermText(dfn, type, term) {\n let text = term;\n if (type === \"enum-value\") {\n text = `\"${text}\"`;\n }\n if (CODE_TYPES.has(type) || dfn.dataset.idl || dfn.closest(\"code\")) {\n text = `<code>${text}</code>`;\n }\n return text;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} [term=\"\"]\n */\nfunction getLocalTermSuffix(dfn, type, term = \"\") {\n if (term.startsWith(\"[[\")) {\n const parent = getLocalTermParentContext(dfn);\n return `internal slot for <code>${parent}</code>`;\n }\n\n switch (type) {\n case \"dict-member\":\n case \"method\":\n case \"attribute\":\n case \"enum-value\": {\n const typeText =\n type === \"dict-member\" ? \"member\" : type.replace(\"-\", \" \");\n const parent = getLocalTermParentContext(dfn);\n return `${typeText} for <code>${parent}</code>`;\n }\n case \"interface\":\n case \"dictionary\":\n case \"enum\": {\n return type;\n }\n case \"constructor\": {\n const parent = getLocalTermParentContext(dfn);\n return `for <code>${parent}</code>`;\n }\n default:\n return \"\";\n }\n}\n\nfunction appendSectionNumbers() {\n const getSectionNumber = id => {\n const dfn = document.getElementById(id);\n const sectionNumberEl = dfn.closest(\"section\").querySelector(\".secno\");\n const secNum = `§${sectionNumberEl.textContent.trim()}`;\n return html`<span class=\"print-only\">${secNum}</span>`;\n };\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"#index-defined-here li[data-id]\");\n elems.forEach(el => el.append(getSectionNumber(el.dataset.id)));\n}\n\nfunction createExternalTermIndex() {\n const data = collectExternalTerms();\n const dataSortedBySpec = [...data.entries()].sort(([specA], [specB]) =>\n specA.localeCompare(specB)\n );\n return html`<ul class=\"index\">\n ${dataSortedBySpec.map(\n ([spec, entries]) => html`<li data-spec=\"${spec}\">\n ${renderInlineCitation(spec)} defines the following:\n <ul>\n ${entries\n .sort((a, b) => a.term.localeCompare(b.term))\n .map(renderExternalTermEntry)}\n </ul>\n </li>`\n )}\n </ul>`;\n}\n\nfunction collectExternalTerms() {\n /** @type {Set<string>} */\n const uniqueReferences = new Set();\n /** @type {Map<string, Entry[]>} spec => entry[] */\n const data = new Map();\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elements = document.querySelectorAll(`a[data-cite]`);\n for (const elem of elements) {\n if (!elem.dataset.cite) {\n continue;\n }\n const uniqueID = elem.href;\n if (uniqueReferences.has(uniqueID)) {\n continue;\n }\n\n const { type, linkFor } = elem.dataset;\n const term = getTermFromElement(elem);\n if (!term) {\n continue; // <a data-cite=\"SPEC\"></a>\n }\n const spec = toCiteDetails(elem).key.toUpperCase();\n\n const entriesBySpec = data.get(spec) || data.set(spec, []).get(spec);\n entriesBySpec.push({ term, type, linkFor, elem });\n uniqueReferences.add(uniqueID);\n }\n\n return data;\n}\n\n/**\n * @param {Entry} entry\n * @returns {HTMLLIElement}\n */\nfunction renderExternalTermEntry(entry) {\n const { elem } = entry;\n const text = getTermText(entry);\n const el = html`<li>\n <span class=\"index-term\" data-href=\"${elem.href}\">${{ html: text }}</span>\n </li>`;\n return el;\n}\n\n// Terms of these _types_ are suffixed with their type info.\nconst TYPED_TYPES = new Map([\n [\"attribute\", \"attribute\"],\n [\"element-attr\", \"attribute\"],\n [\"element\", \"element\"],\n [\"enum\", \"enum\"],\n [\"exception\", \"exception\"],\n [\"extended-attribute\", \"extended attribute\"],\n [\"interface\", \"interface\"],\n]);\n\n// These _terms_ have type suffix \"type\".\nconst TYPE_TERMS = new Set([\n // Following are primitive types as per WebIDL spec:\n \"boolean\",\n \"byte\",\n \"octet\",\n \"short\",\n \"unsigned short\",\n \"long\",\n \"unsigned long\",\n \"long long\",\n \"unsigned long long\",\n \"float\",\n \"unrestricted float\",\n \"double\",\n \"unrestricted double\",\n // Following are not primitive types, but aren't interfaces either.\n \"undefined\",\n \"any\",\n \"object\",\n \"symbol\",\n]);\n\n/** @param {Entry} entry */\nfunction getTermText(entry) {\n const { term, type, linkFor } = entry;\n let text = term;\n\n if (CODE_TYPES.has(type)) {\n if (type === \"extended-attribute\") {\n text = `[${text}]`;\n }\n text = `<code>${text}</code>`;\n }\n\n const typeSuffix = TYPE_TERMS.has(term) ? \"type\" : TYPED_TYPES.get(type);\n if (typeSuffix) {\n text += ` ${typeSuffix}`;\n }\n\n if (linkFor) {\n let linkForText = linkFor;\n if (!/\\s/.test(linkFor)) {\n // If linkFor is a single word, highlight it.\n linkForText = `<code>${linkForText}</code>`;\n }\n if (type === \"element-attr\") {\n linkForText += \" element\";\n }\n text += ` (for ${linkForText})`;\n }\n\n return text;\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n doc\n .querySelectorAll(\"#index-defined-elsewhere li[data-spec]\")\n .forEach(el => el.removeAttribute(\"data-spec\"));\n\n doc\n .querySelectorAll(\"#index-defined-here li[data-id]\")\n .forEach(el => el.removeAttribute(\"data-id\"));\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n/**\n * Module: core/webidl-index\n * constructs a summary of WebIDL in the document by\n * cloning all the generated WebIDL nodes and\n * appending them to pre element.\n *\n * Usage\n * Add a <section id=\"idl-index\"> to the document.\n * It also supports title elements to generate a header.\n * Or if a header element is an immediate child, then\n * that is preferred.\n */\nexport const name = \"core/webidl-index\";\nimport { nonNormativeSelector, wrapInner } from \"./utils.js\";\nimport { addIDLHeader } from \"./webidl.js\";\n\nexport function run() {\n /** @type {HTMLElement | null} */\n const idlIndexSec = document.querySelector(\"section#idl-index\");\n if (!idlIndexSec) {\n return;\n }\n // Query for decedents headings, e.g., \"h2:first-child, etc..\"\n const query = [2, 3, 4, 5, 6].map(level => `h${level}:first-child`).join(\",\");\n if (!idlIndexSec.querySelector(query)) {\n const header = document.createElement(\"h2\");\n if (idlIndexSec.title) {\n header.textContent = idlIndexSec.title;\n idlIndexSec.removeAttribute(\"title\");\n } else {\n header.textContent = \"IDL Index\";\n }\n idlIndexSec.prepend(header);\n }\n\n // filter out the IDL marked with class=\"exclude\" and the IDL in non-normative sections\n const idlIndex = Array.from(\n document.querySelectorAll(\"pre.idl:not(.exclude) > code\")\n ).filter(idl => !idl.closest(nonNormativeSelector));\n\n if (idlIndex.length === 0) {\n const text = \"This specification doesn't normatively declare any Web IDL.\";\n idlIndexSec.append(text);\n return;\n }\n\n const pre = document.createElement(\"pre\");\n pre.classList.add(\"idl\", \"def\");\n pre.id = \"actual-idl-index\";\n idlIndex\n .map(elem => {\n const fragment = document.createDocumentFragment();\n for (const child of elem.children) {\n fragment.appendChild(child.cloneNode(true));\n }\n return fragment;\n })\n .forEach(elem => {\n if (pre.lastChild) {\n pre.append(\"\\n\\n\");\n }\n pre.appendChild(elem);\n });\n // Remove duplicate IDs\n pre.querySelectorAll(\"*[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n\n // Add our own IDL header\n idlIndexSec.appendChild(pre);\n wrapInner(pre, document.createElement(\"code\"));\n addIDLHeader(pre);\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大纲\",\n },\n ko: {\n toc: \"목차\",\n },\n ja: {\n toc: \"目次\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at §1, we will keep §1.1 but not §1.1.1\n // Similarly, `data-max-toc=1` will keep §1, but not §1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"이 부분은 비규범적입니다.\",\n },\n ja: {\n informative: \"この節は仕様には含まれません.\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"本章节不包含规范性内容。\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","/* container for stats */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n\n.caniuse-stats {\n display: flex;\n column-gap: 2em;\n}\n\n.caniuse-group {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: flex-end;\n flex-basis: auto;\n}\n\n.caniuse-browsers {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-top: .2em;\n column-gap: .4em;\n border-bottom: 1px solid #ccc;\n row-gap: .4em;\n padding-bottom: .4cm;\n}\n\n.caniuse-type {\n align-self: center;\n border-top: none;\n text-transform: capitalize;\n font-size: .8em;\n margin-top: -.8em;\n font-weight: bold;\n}\n\n.caniuse-type span {\n background-color: white;\n padding: 0 0.4em;\n}\n\n/* a browser version */\n.caniuse-cell {\n align-items: center;\n border-radius: 1cm;\n color: #fff;\n display: flex;\n font-size: 90%;\n min-width: 1.5cm;\n padding: .3rem;\n justify-content: space-evenly;\n --supported: #2a8436dd;\n --no-support: #c44230dd;\n --no-support-alt: #b43b2bdd;\n --partial: #807301dd;\n --partial-alt: #746c00dd;\n --unknown: #757575;\n\n background: repeating-linear-gradient(\n var(--caniuse-angle, 45deg),\n var(--caniuse-bg) 0,\n var(--caniuse-bg-alt) 1px,\n var(--caniuse-bg-alt) 0.4em,\n var(--caniuse-bg) calc(0.25em + 1px),\n var(--caniuse-bg) 0.75em\n );\n}\n\nimg.caniuse-browser {\n filter: drop-shadow(0px 0px .1cm #666666);\n}\n\n.caniuse-cell span.browser-version {\n margin-left: 0.4em;\n text-shadow: 0 0 0.1em #fff;\n font-weight: 100;\n font-size: .9em;\n}\n\n.caniuse-stats a[href] {\n white-space: nowrap;\n align-self: flex-end;\n}\n\n/* supports */\n.caniuse-cell.y {\n background: var(--supported);\n}\n\n/* no support, disabled by default */\n.caniuse-cell:is(.n,.d) {\n --caniuse-angle: 45deg;\n --caniuse-bg: var(--no-support);\n --caniuse-bg-alt: var(--no-support-alt);\n}\n\n.caniuse-cell.u {\n background: var(--unknown);\n}\n\n.caniuse-cell.d {\n --caniuse-angle: 180deg;\n}\n\n/* not supported by default / partial support etc\nsee https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md for stats */\n.caniuse-cell:is(.a,.x,.p) {\n --caniuse-angle: 90deg;\n --caniuse-bg: var(--partial);\n --caniuse-bg-alt: var(--partial-alt);\n}\n\n/* handle case when printing */\n@media print {\n .caniuse-cell.y::before {\n content: \"✔️\";\n padding: 0.5em;\n }\n\n .caniuse-cell.n::before {\n content: \"❌\";\n padding: 0.5em;\n }\n\n .caniuse-cell:is(.a,.d,.p,.x,.u)::before {\n content: \"⚠️\";\n padding: 0.5em;\n }\n}\n`;\n","// @ts-check\n/**\n * Module: \"core/caniuse\"\n * Adds a caniuse support table for a \"feature\" #1238\n * Usage options: https://github.com/w3c/respec/wiki/caniuse\n */\nimport { codedJoinAnd, docLink, showError, showWarning } from \"./utils.js\";\nimport { pub, sub } from \"./pubsubhub.js\";\nimport css from \"../styles/caniuse.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/caniuse\";\n\nconst API_URL = \"https://respec.org/caniuse/\";\n\nexport const BROWSERS = new Map([\n [\"and_chr\", { name: \"Android Chrome\", path: \"chrome\", type: \"mobile\" }],\n [\"and_ff\", { name: \"Android Firefox\", path: \"firefox\", type: \"mobile\" }],\n [\"and_uc\", { name: \"Android UC\", path: \"uc\", type: \"mobile\" }],\n [\"chrome\", { name: \"Chrome\", type: \"desktop\" }],\n [\"edge\", { name: \"Edge\", type: \"desktop\" }],\n [\"firefox\", { name: \"Firefox\", type: \"desktop\" }],\n [\"ios_saf\", { name: \"iOS Safari\", path: \"safari-ios\", type: \"mobile\" }],\n [\"op_mob\", { name: \"Opera Mobile\", path: \"opera\", type: \"mobile\" }],\n [\"opera\", { name: \"Opera\", type: \"desktop\" }],\n [\"safari\", { name: \"Safari\", type: \"desktop\" }],\n [\n \"samsung\",\n { name: \"Samsung Internet\", path: \"samsung-internet\", type: \"mobile\" },\n ],\n]);\n\nconst statToText = new Map([\n [\"a\", \"almost supported (aka Partial support)\"],\n [\"d\", \"disabled by default\"],\n [\"n\", \"no support, or disabled by default\"],\n [\"p\", \"no support, but has Polyfill\"],\n [\"u\", \"unknown support\"],\n [\"x\", \"requires prefix to work\"],\n [\"y\", \"supported by default\"],\n]);\n\nexport function prepare(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n normalizeCaniuseConf(conf);\n validateBrowsers(conf);\n const options = conf.caniuse;\n if (!options.feature) {\n return; // no feature to show\n }\n\n document.head.appendChild(html`<style\n id=\"caniuse-stylesheet\"\n class=\"${options.removeOnSave ? \"removeOnSave\" : \"\"}\"\n >\n ${css}\n </style>`);\n}\n/**\n * @param {string} browser\n * @returns\n */\nfunction getLogoSrc(browser) {\n const path = BROWSERS.get(browser).path ?? browser;\n return `https://cdn.w3.org/assets/logos/browser-logos/${path}/${path}.svg`;\n}\n\nexport async function run(conf) {\n const options = conf.caniuse;\n if (!options?.feature) return;\n\n const featureURL = new URL(options.feature, \"https://caniuse.com/\").href;\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = fetchStats(conf.caniuse)\n .then(json => processJson(json, options))\n .catch(err => handleError(err, options, featureURL));\n const definitionPair = html`<dt class=\"caniuse-title\">Browser support:</dt>\n <dd class=\"caniuse-stats\">\n ${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}\n </dd>`;\n headDlElem.append(...definitionPair.childNodes);\n await contentPromise;\n pub(\"amend-user-config\", { caniuse: options.feature });\n if (options.removeOnSave) {\n // Will remove the browser support cells.\n headDlElem\n .querySelectorAll(\".caniuse-browser\")\n .forEach(elem => elem.classList.add(\"removeOnSave\"));\n sub(\"beforesave\", outputDoc => {\n html.bind(outputDoc.querySelector(\".caniuse-stats\"))`\n <a href=\"${featureURL}\">caniuse.com</a>`;\n });\n }\n}\n\nfunction handleError(err, options, featureURL) {\n const msg = `Failed to retrieve feature \"${options.feature}\".`;\n const hint = docLink`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${\"[caniuse]\"}.`;\n showError(msg, name, { hint });\n console.error(err);\n return html`<a href=\"${featureURL}\">caniuse.com</a>`;\n}\n\n/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction normalizeCaniuseConf(conf) {\n const defaultBrowsers = new Set(BROWSERS.keys());\n defaultBrowsers.delete(\"op_mob\");\n defaultBrowsers.delete(\"opera\");\n const DEFAULTS = { removeOnSave: true, browsers: [...defaultBrowsers] };\n if (typeof conf.caniuse === \"string\") {\n conf.caniuse = { feature: conf.caniuse, ...DEFAULTS };\n return;\n }\n conf.caniuse = { ...DEFAULTS, ...conf.caniuse };\n}\n\nfunction validateBrowsers({ caniuse }) {\n const { browsers } = caniuse;\n const invalidBrowsers = browsers.filter(browser => !BROWSERS.has(browser));\n if (invalidBrowsers.length) {\n const names = codedJoinAnd(invalidBrowsers, { quotes: true });\n const msg = docLink`Invalid browser(s): (${names}) in the \\`browser\\` property of ${\"[caniuse]\"}.`;\n showWarning(msg, name);\n }\n}\n\nasync function processJson(json, { feature }) {\n /** @type {Array} */\n const results = json.result;\n const groups = new Map([\n [\"desktop\", []],\n [\"mobile\", []],\n ]);\n const toBrowserCell = browserCellRenderer(feature);\n results.reduce(toBrowserCell, groups);\n const out = [...groups]\n .filter(([, arr]) => arr.length)\n .map(\n ([key, arr]) =>\n html`<div class=\"caniuse-group\">\n <div class=\"caniuse-browsers\">${arr}</div>\n <div class=\"caniuse-type\"><span>${key}</div>\n </div>`\n );\n out.push(\n html`<a class=\"caniuse-cell\" href=\"https://caniuse.com/${feature}\"\n >More info</a\n >`\n );\n return out;\n}\n\nfunction browserCellRenderer(feature) {\n return (groups, { browser: browserId, version, caniuse }) => {\n const { name, type } = BROWSERS.get(browserId);\n const versionLong = version ? ` version ${version}` : \"\";\n const browserName = `${name}${versionLong}`;\n const supportLevel = statToText.get(caniuse);\n const ariaLabel = `${feature} is ${supportLevel} since ${browserName} on ${type}.`;\n const cssClass = `caniuse-cell ${caniuse}`;\n const title = capitalize(`${supportLevel} since ${browserName}.`);\n const textVersion = version ? version : \"—\";\n const src = getLogoSrc(browserId);\n const result = html`\n <div class=\"${cssClass}\" title=\"${title}\" aria-label=\"${ariaLabel}\">\n <img\n class=\"caniuse-browser\"\n width=\"20\"\n height=\"20\"\n src=\"${src}\"\n alt=\"${name} logo\"\n /><span class=\"browser-version\">${textVersion}</span>\n </div>\n `;\n groups.get(type).push(result);\n return groups;\n };\n}\n\n/**\n * @typedef {Record<string, [string, string[]][]>} ApiResponse\n * @throws {Error} on failure\n */\nasync function fetchStats(options) {\n const { feature, browsers, apiURL } = options;\n const url = new URL(apiURL || `./${feature}`, API_URL);\n browsers.forEach(browser => url.searchParams.append(\"browsers\", browser));\n const response = await fetch(url);\n if (!response.ok) {\n const { status, statusText } = response;\n throw new Error(`Failed to get caniuse data: (${status}) ${statusText}`);\n }\n return response.json();\n}\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.mdn {\n font-size: 0.75em;\n position: absolute;\n right: 0.3em;\n min-width: 0;\n margin-top: 3rem;\n}\n\n.mdn details {\n width: 100%;\n margin: 1px 0;\n position: relative;\n z-index: 10;\n box-sizing: border-box;\n padding: 0.4em;\n padding-top: 0;\n}\n\n.mdn details[open] {\n min-width: 25ch;\n max-width: 32ch;\n background: #fff;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n z-index: 11;\n margin-bottom: 0.4em;\n}\n\n.mdn summary {\n text-align: right;\n cursor: default;\n margin-right: -0.4em;\n}\n\n.mdn summary span {\n font-family: zillaslab, Palatino, \"Palatino Linotype\", serif;\n color: #fff;\n background-color: #000;\n display: inline-block;\n padding: 3px;\n}\n\n.mdn a {\n display: inline-block;\n word-break: break-all;\n}\n\n.mdn p {\n margin: 0;\n}\n\n.mdn .engines-all {\n color: #058b00;\n}\n.mdn .engines-some {\n color: #b00;\n}\n\n.mdn table {\n width: 100%;\n font-size: 0.9em;\n}\n\n.mdn td {\n border: none;\n}\n\n.mdn td:nth-child(2) {\n text-align: right;\n}\n\n.mdn .nosupportdata {\n font-style: italic;\n margin: 0;\n}\n\n.mdn tr::before {\n content: \"\";\n display: table-cell;\n width: 1.5em;\n height: 1.5em;\n background: no-repeat center center / contain;\n font-size: 0.75em;\n}\n\n.mdn .no,\n.mdn .unknown {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdn .no::before,\n.mdn .unknown::before {\n opacity: 0.5;\n}\n\n.mdn .chrome::before,\n.mdn .chrome_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/chrome/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/edge/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/firefox/firefox.svg);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/opera/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/safari/safari.svg);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/android-webview/android-webview.png);\n}\n`;\n","// @ts-check\nimport { fetchAndCache, getIntlData, showError } from \"./utils.js\";\nimport css from \"../styles/mdn-annotation.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/mdn-annotation\";\n\nconst BASE_JSON_PATH = \"https://w3c.github.io/mdn-spec-links/\";\nconst MDN_URL_BASE = \"https://developer.mozilla.org/en-US/docs/Web/\";\nconst MDN_BROWSERS = {\n // The browser IDs here must match the ones in the imported JSON data.\n // See the list of browser IDs at:\n // https://github.com/mdn/browser-compat-data/blob/master/schemas/compat-data-schema.md#browser-identifiers.\n chrome: \"Chrome\",\n chrome_android: \"Chrome Android\",\n edge: \"Edge\",\n edge_mobile: \"Edge Mobile\",\n firefox: \"Firefox\",\n firefox_android: \"Firefox Android\",\n // nodejs: \"Node.js\", // no data for features in HTML\n opera: \"Opera\",\n opera_android: \"Opera Android\",\n // qq_android: \"QQ Browser\", // not enough data for features in HTML\n safari: \"Safari\",\n safari_ios: \"Safari iOS\",\n samsunginternet_android: \"Samsung Internet\",\n // uc_android: \"UC browser\", // not enough data for features in HTML\n // uc_chinese_android: \"Chinese UC Browser\", // not enough data for features in HTML\n webview_android: \"WebView Android\",\n};\n\nconst localizationStrings = {\n en: {\n inAllEngines: \"This feature is in all major engines.\",\n inSomeEngines: \"This feature has limited support.\",\n },\n zh: {\n inAllEngines: \"所有主要引擎均支持此特性。\",\n inSomeEngines: \"此功能支持有限。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {HTMLElement} node\n */\nfunction insertMDNBox(node) {\n const targetAncestor = node.closest(\"section\");\n if (!targetAncestor) return;\n const { previousElementSibling: targetSibling } = targetAncestor;\n if (targetSibling && targetSibling.classList.contains(\"mdn\")) {\n // If the target ancestor already has a mdnBox inserted, we just use it\n return targetSibling;\n }\n const mdnBox = html`<aside class=\"mdn\"></aside>`;\n targetAncestor.before(mdnBox);\n return mdnBox;\n}\n\n/**\n * @param {MdnEntry} mdnSpec\n * @returns {HTMLDetailsElement}\n */\nfunction attachMDNDetail(mdnSpec) {\n const { name, slug, summary, support, engines } = mdnSpec;\n const mdnSubPath = slug.slice(slug.indexOf(\"/\") + 1);\n const href = `${MDN_URL_BASE}${slug}`;\n const label = `Expand MDN details for ${name}`;\n const engineSupport = getEngineSupportIcons(engines);\n return html`<details>\n <summary aria-label=\"${label}\"><span>MDN</span>${engineSupport}</summary>\n <a title=\"${summary}\" href=\"${href}\">${mdnSubPath}</a>\n ${getEngineSupport(engines)}\n ${support\n ? buildBrowserSupportTable(support)\n : html`<p class=\"nosupportdata\">No support data.</p>`}\n </details>`;\n}\n\n/**\n * @param {MdnEntry['support']} support\n * @returns {HTMLTableElement}\n */\nfunction buildBrowserSupportTable(support) {\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {\"Yes\" | \"No\" | \"Unknown\"} yesNoUnknown\n * @param {string} version\n * @returns {HTMLTableRowElement}\n */\n function createRow(browserId, yesNoUnknown, version) {\n const displayStatus = yesNoUnknown === \"Unknown\" ? \"?\" : yesNoUnknown;\n const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`;\n return html`<tr class=\"${classList}\">\n <td>${MDN_BROWSERS[browserId]}</td>\n <td>${version ? version : displayStatus}</td>\n </tr>`;\n }\n\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {VersionDetails} versionData\n */\n function createRowFromBrowserData(browserId, versionData) {\n if (versionData.version_removed) {\n return createRow(browserId, \"No\", \"\");\n }\n const versionAdded = versionData.version_added;\n if (typeof versionAdded === \"boolean\") {\n return createRow(browserId, versionAdded ? \"Yes\" : \"No\", \"\");\n } else if (!versionAdded) {\n return createRow(browserId, \"Unknown\", \"\");\n } else {\n return createRow(browserId, \"Yes\", `${versionAdded}+`);\n }\n }\n\n return html`<table>\n ${Object.keys(MDN_BROWSERS).map(browserId => {\n return support[browserId]\n ? createRowFromBrowserData(browserId, support[browserId])\n : createRow(browserId, \"Unknown\", \"\");\n })}\n </table>`;\n}\n\nexport async function run(conf) {\n const mdnKey = getMdnKey(conf);\n if (!mdnKey) return;\n\n const mdnSpecJson = await getMdnData(mdnKey, conf.mdn);\n if (!mdnSpecJson) return;\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.append(style);\n\n for (const elem of findElements(mdnSpecJson)) {\n const mdnSpecArray = mdnSpecJson[elem.id];\n const mdnBox = insertMDNBox(elem);\n if (!mdnBox) continue;\n for (const spec of mdnSpecArray) {\n mdnBox.append(attachMDNDetail(spec));\n }\n }\n}\n\n/** @returns {string} */\nfunction getMdnKey(conf) {\n const { shortName, mdn } = conf;\n if (!mdn) return;\n if (typeof mdn === \"string\") return mdn;\n return mdn.key || shortName;\n}\n\n/**\n * @param {string} key MDN key\n * @param {object} mdnConf\n * @param {string} [mdnConf.specMapUrl]\n * @param {string} [mdnConf.baseJsonPath]\n * @param {number} [mdnConf.maxAge]\n *\n * @typedef {{ version_added: string|boolean|null, version_removed?: string }} VersionDetails\n * @typedef {Record<string | keyof MDN_BROWSERS, VersionDetails>} MdnSupportEntry\n * @typedef {{ name: string, title: string, slug: string, summary: string, support: MdnSupportEntry, engines: string[] }} MdnEntry\n * @typedef {Record<string, MdnEntry[]>} MdnData\n * @returns {Promise<MdnData|undefined>}\n */\nasync function getMdnData(key, mdnConf) {\n const { baseJsonPath = BASE_JSON_PATH, maxAge = 60 * 60 * 24 * 1000 } =\n mdnConf;\n const url = new URL(`${key}.json`, baseJsonPath).href;\n const res = await fetchAndCache(url, maxAge);\n if (res.status === 404) {\n const msg = `Could not find MDN data associated with key \"${key}\".`;\n const hint = \"Please add a valid key to `respecConfig.mdn`\";\n showError(msg, name, { hint });\n return;\n }\n return await res.json();\n}\n\n/**\n * Find elements that can have an annotation box attached.\n * @param {MdnData} data\n */\nfunction findElements(data) {\n /** @type {NodeListOf<HTMLElement>} */\n const elemsWithId = document.body.querySelectorAll(\"[id]:not(script)\");\n return [...elemsWithId].filter(({ id }) => Array.isArray(data[id]));\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLSpanElement}\n */\nfunction getEngineSupportIcons(engines) {\n if (engines.length === 3) {\n return html`<span title=\"${l10n.inAllEngines}\">✅</span>`;\n }\n if (engines.length < 2) {\n return html`<span title=\"${l10n.inSomeEngines}\">🚫</span>`;\n }\n return html`<span> </span>`;\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLParagraphElement|undefined}\n */\nfunction getEngineSupport(engines) {\n if (engines.length === 3) {\n return html`<p class=\"engines-all\">${l10n.inAllEngines}</p>`;\n }\n if (engines.length < 2) {\n return html`<p class=\"engines-some\">${l10n.inSomeEngines}</p>`;\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"保存する\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"导出\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"仕様検索\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"搜索 Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"🔎\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/xref/\";\n\nconst localizationStrings = {\n en: {\n title: \"Search definitions\",\n },\n ja: {\n title: \"定義検索\",\n },\n de: {\n title: \"Definitionen durchsuchen\",\n },\n zh: {\n title: \"搜索定义\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(l10n.title, show, \"Ctrl+Shift+Alt+x\", \"📚\");\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n const xrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=\"${onLoad}\"></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.title, xrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关于\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"これについて\",\n },\n de: {\n about_respec: \"Über\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ℹ️\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/w3c/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\n\nexport const name = \"core/seo\";\n\nexport function run() {\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","// @ts-check\n// Module w3c/seo\n// Manages SEO information for documents\n// e.g. set the canonical URL for the document if configured\nimport { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { resolveRef } from \"../core/biblio.js\";\nimport { showWarning } from \"../core/utils.js\";\nexport const name = \"w3c/seo\";\n\nconst status2rdf = {\n NOTE: \"w3p:NOTE\",\n WD: \"w3p:WD\",\n LC: \"w3p:LastCall\",\n CR: \"w3p:CR\",\n CRD: \"w3p:CRD\",\n PR: \"w3p:PR\",\n REC: \"w3p:REC\",\n PER: \"w3p:PER\",\n RSCND: \"w3p:RSCND\",\n};\n\nexport const requiresCanonicalLink = new Set([\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n \"BG-FINAL\",\n \"CG-FINAL\",\n \"CRY\",\n \"DRY\",\n \"draft-finding\",\n \"finding\",\n]);\n\nexport async function run(conf) {\n // Don't include a canonical URL for documents that haven't been published.\n if (\n (!conf.canonicalURI && !requiresCanonicalLink.has(conf.specStatus)) ||\n !conf.shortName\n ) {\n return;\n }\n switch (conf.canonicalURI) {\n case \"edDraft\":\n if (conf.edDraftURI) {\n conf.canonicalURI = new URL(\n conf.edDraftURI,\n document.location.href\n ).href;\n } else {\n const msg = `Canonical URI set to edDraft, but no edDraftURI is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n case \"TR\":\n if (conf.latestVersion) {\n conf.canonicalURI = conf.latestVersion;\n } else {\n const msg = `Canonical URI set to TR, but no shortName is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n default:\n if (conf.latestVersion && !conf.canonicalURI) {\n conf.canonicalURI = conf.latestVersion;\n }\n }\n if (conf.canonicalURI) {\n const linkElem = html`<link rel=\"canonical\" href=\"${conf.canonicalURI}\" />`;\n document.head.appendChild(linkElem);\n }\n\n if (conf.doJsonLd) {\n await addJSONLDInfo(conf, document);\n }\n}\n\nasync function addJSONLDInfo(conf, doc) {\n const rdfStatus = status2rdf[conf.specStatus];\n // Content for JSON\n const type = [\"TechArticle\"];\n if (rdfStatus) type.push(rdfStatus);\n\n const jsonld = {\n \"@context\": [\n \"http://schema.org\",\n {\n \"@vocab\": \"http://schema.org/\",\n \"@language\": doc.documentElement.lang || \"en\",\n w3p: \"http://www.w3.org/2001/02pd/rec54#\",\n foaf: \"http://xmlns.com/foaf/0.1/\",\n datePublished: { \"@type\": \"http://www.w3.org/2001/XMLSchema#date\" },\n inLanguage: { \"@language\": null },\n isBasedOn: { \"@type\": \"@id\" },\n license: { \"@type\": \"@id\" },\n },\n ],\n id: conf.canonicalURI || conf.thisVersion,\n type,\n name: document.title,\n inLanguage: doc.documentElement.lang || \"en\",\n license: conf.licenseInfo?.url,\n datePublished: conf.dashDate,\n /** @type {{ name: string, url?: string } | { name: string, url?: string }[]} */\n copyrightHolder: {\n name: \"World Wide Web Consortium\",\n url: \"https://www.w3.org/\",\n },\n discussionUrl: conf.issueBase,\n alternativeHeadline: conf.subtitle,\n isBasedOn: conf.prevVersion,\n };\n\n // add any additional copyright holders\n if (conf.additionalCopyrightHolders) {\n const addl = Array.isArray(conf.additionalCopyrightHolders)\n ? conf.additionalCopyrightHolders\n : [conf.additionalCopyrightHolders];\n jsonld.copyrightHolder = [\n jsonld.copyrightHolder,\n ...addl.map(h => ({ name: h })),\n ];\n }\n\n // description from meta description\n const description = doc.head.querySelector(\"meta[name=description]\");\n if (description) {\n jsonld.description = description.content;\n }\n\n // Editors\n if (conf.editors) {\n jsonld.editor = conf.editors.map(addPerson);\n }\n if (conf.authors) {\n jsonld.contributor = conf.authors.map(addPerson);\n }\n\n // normative and informative references\n const citationIds = [\n ...conf.normativeReferences,\n ...conf.informativeReferences,\n ];\n const citationContents = await Promise.all(\n citationIds.map(ref => resolveRef(ref))\n );\n jsonld.citation = citationContents\n .filter(ref => typeof ref === \"object\")\n .map(addRef);\n\n const script = doc.createElement(\"script\");\n script.type = \"application/ld+json\";\n script.textContent = JSON.stringify(jsonld, null, 2);\n doc.head.appendChild(script);\n}\n\n/**\n * Turn editors and authors into a list of JSON-LD relationships\n */\nfunction addPerson({ name, url, mailto, company, companyURL }) {\n const ed = {\n type: \"Person\",\n name,\n url,\n \"foaf:mbox\": mailto,\n };\n if (company || companyURL) {\n ed.worksFor = {\n name: company,\n url: companyURL,\n };\n }\n return ed;\n}\n\n/**\n * Create a reference URL from the ref\n */\nfunction addRef(ref) {\n const { href: id, title: name, href: url } = ref;\n const jsonld = {\n id,\n type: \"TechArticle\",\n name,\n url,\n };\n if (ref.authors) {\n jsonld.creator = ref.authors.map(a => ({ name: a }));\n }\n if (ref.rawDate) {\n jsonld.publishedDate = ref.rawDate;\n }\n if (ref.isbn) {\n jsonld.identifier = ref.isbn;\n }\n if (ref.publisher) {\n jsonld.publisher = { name: ref.publisher };\n }\n return jsonld;\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${\"[testSuiteURI]\"} が見つかりません.`,\n tests: \"テスト\",\n test: \"テスト\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`本规范中包含测试,但在 ReSpec 配置中缺少 ${\"[testSuiteURI]\"}。`,\n tests: \"测试\",\n test: \"测试\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"🔒\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"💪\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n showError(l10n.missing_test_suite_uri, name);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener(\"click\", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n [\"respec-hl-c1\", true],\n [\"respec-hl-c2\", true],\n [\"respec-hl-c3\", true],\n [\"respec-hl-c4\", true],\n [\"respec-hl-c5\", true],\n [\"respec-hl-c6\", true],\n [\"respec-hl-c7\", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get(\"respec-hl-c1\") === true) return \"respec-hl-c1\";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || \"respec-hl-c1\";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"section\") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains(\"respec-hl\");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove(\"respec-hl\", highlightColor);\n // clean up empty class attributes so they don't come in export\n if (!el.classList.length) el.removeAttribute(\"class\");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add(\"respec-hl\", highlightColor);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n color: black;\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => html`<li>\n ${toLinkProps(entry).map(\n link =>\n html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a>${\" \"}`\n )}\n </li>`;\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","// @ts-check\n/**\n * This module adds a \"monetization\" meta-tag to enable web-monetization.\n *\n * The meta-tag is added only to \"live\" documents, and is removed from generated\n * static documents.\n */\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/web-monetization\";\n\nexport function run(conf) {\n if (conf.monetization === false) {\n return;\n }\n const { monetization } = conf;\n\n const { removeOnSave, paymentPointer } = canonicalizeConfig(monetization);\n\n const cssClass = removeOnSave ? \"removeOnSave\" : null;\n document.head.append(html`<meta\n name=\"monetization\"\n content=\"${paymentPointer}\"\n class=\"${cssClass}\"\n />`);\n}\n\n/**\n * @param {object|string} rawConfig\n * - {string} paymentPointer - The payment pointer to use.\n * - {boolean} removeOnSave - Whether to remove the meta tag when the document is saved.\n */\nfunction canonicalizeConfig(rawConfig) {\n const config = {\n paymentPointer: \"$respec.org\",\n removeOnSave: true,\n };\n switch (typeof rawConfig) {\n case \"string\":\n config.paymentPointer = rawConfig;\n break;\n case \"object\":\n if (rawConfig.paymentPointer) {\n config.paymentPointer = String(rawConfig.paymentPointer);\n }\n if (rawConfig.removeOnSave === false) {\n config.removeOnSave = false;\n }\n break;\n }\n return config;\n}\n","import { docLink, showError } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/before-save\";\n\nexport function run(conf) {\n if (!conf.beforeSave) return;\n\n if (\n !Array.isArray(conf.beforeSave) ||\n conf.beforeSave.some(\n el => typeof el !== \"function\" || el.constructor.name === \"AsyncFunction\"\n )\n ) {\n const msg = docLink`${\"[beforeSave]\"} configuration option must be an array of synchronous JS functions.`;\n showError(msg, name);\n return;\n }\n\n sub(\n \"beforesave\",\n documentElement => {\n performTransformations(conf.beforeSave, documentElement.ownerDocument);\n },\n { once: true }\n );\n}\n/**\n * @param {Array<Function>} transforms\n * @param {Document}\n */\nfunction performTransformations(transforms, doc) {\n let pos = 0;\n for (const fn of transforms) {\n try {\n fn(doc);\n } catch (err) {\n const nameOrPosition = `\\`${fn.name}\\`` || `at position ${pos}`;\n const msg = docLink`Function ${nameOrPosition}\\` threw an error during processing of ${\"[beforeSave]\"}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n } finally {\n pos++;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`<meta>\\` 标签`,\n hint: `将此行添加到文档的 \\`<head>\\` 部分—— \\`<meta charset=\"utf-8\">\\` 或将 charset 设置为 utf-8(如果尚未设置)。`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"check-internal-slots\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-internal-slots\";\nexport const name = \"core/linter-rules/check-internal-slots\";\n\nconst localizationStrings = {\n en: {\n msg: \"Internal slots should be preceded by a '.'\",\n hint: \"Add a '.' between the elements mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"var+a\");\n const offendingElements = [...elems].filter(\n ({ previousSibling: { nodeName } }) => {\n const isPrevVar = nodeName && nodeName === \"VAR\";\n return isPrevVar;\n }\n );\n\n if (!offendingElements.length) {\n return;\n }\n\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-captionless-tables\".\n *\n * Checks that there are no tables in the document which don't start\n * with a caption element.\n *\n * As some tables may not contain tabular data, this only applies to\n * tables marked with class=\"numbered\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-captionless-tables\";\nexport const name = \"core/linter-rules/no-captionless-tables\";\n\nconst localizationStrings = {\n en: {\n msg: \"All tables marked with class='numbered' must start with a caption element.\",\n hint: \"Add a `caption` to the offending table.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n const offendingElements = [...tables].filter(\n table => !(table.firstElementChild instanceof HTMLTableCaptionElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-dfns\".\n *\n * Complains if an internal/un-exported definitions is not linked to.\n */\nimport {\n docLink,\n getIntlData,\n norm,\n showError,\n showWarning,\n} from \"../utils.js\";\n\nconst ruleName = \"no-unused-dfns\";\nexport const name = \"core/linter-rules/no-unused-dfns\";\n\nconst localizationStrings = {\n en: {\n msg(text) {\n return `Found definition for \"${text}\", but nothing links to it. This is usually a spec bug!`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Add a \\`class=\"lint-ignore\"\\` attribute the definition.\n * Either remove the definition or change \\`<dfn>\\` to another type of HTML element.\n * If you meant to ${\"[export|#data-export]\"} the definition, add \\`class=\"export\"\\` to the definition.\n\n To silence this warning entirely, set \\`lint: { \"no-unused-dfns\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n /** @type NodeListOf<HTMLElement> */\n const definitions = document.querySelectorAll(\n \"dfn:not(.lint-ignore, [data-export], [data-cite])\"\n );\n\n const elements = [...definitions].filter(isDfnUnused);\n\n // These are usually bad spec bugs, so best shown individually.\n elements.forEach(element => {\n const elements = [element];\n const text = norm(element.textContent);\n logger(l10n.msg(text), name, { elements, hint: l10n.hint });\n });\n}\n\nfunction isDfnUnused(dfn) {\n // Not in the index\n // and not the \"self-link\" box\n return !document.querySelector(\n `a[href=\"#${dfn.id}\"]:not(.index-term, .self-link)`\n );\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `<div>`。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * The W3C Process requires separate Privacy Considerations and Security\n * Considerations sections. This linter checks for the presence of these\n * sections, and reports an error if they are not present.\n */\n\nimport {\n InsensitiveStringSet,\n docLink,\n getIntlData,\n getIntlDataForKey,\n norm,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { W3CNotes, recTrackStatus } from \"../headers.js\";\n\nconst ruleName = \"required-sections\";\nexport const name = \"w3c/linter-rules/required-sections\";\n\nconst localizationStrings = {\n en: {\n msg(sectionTitle) {\n return `W3C Recommendation track documents require a separate \"${sectionTitle}\" section.`;\n },\n hint(sectionTitle) {\n return docLink`Add a \\`<section>\\` with a \"${sectionTitle}\" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n If the document is not intended for the W3C Recommendation track, set ${\"[noRecTrack]\"} to \\`true\\`\n or turn off the ${`[${ruleName}]`} linter rule.`;\n },\n privacy_considerations: \"Privacy Considerations\",\n security_considerations: \"Security Considerations\",\n },\n es: {\n msg(sectionTitle) {\n return `Documentos que van a ser \"W3C Recommendation\" requieren una sección \"${sectionTitle}\" separada.`;\n },\n hint(sectionTitle) {\n return docLink`Agrega una \\`<section>\\` con título \"${sectionTitle}\". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n Si el documento no está destinado a ser un W3C Recommendation, puedes poner ${\"[noRecTrack]\"} a \\`true\\`\n o apaga la regla de linter ${`[${ruleName}]`}.`;\n },\n privacy_considerations: \"Consideraciones de privacidad\",\n security_considerations: \"Consideraciones de Seguridad\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport const requiresSomeSectionStatus = new Set([...recTrackStatus]);\nrequiresSomeSectionStatus.delete(\"DISC\"); // \"Discontinued Draft\"\n// W3C notes do not require privacy or security considerations sections.\nW3CNotes.forEach(note => requiresSomeSectionStatus.delete(note));\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can't check for headers unless we also have a translation\n if (!getIntlDataForKey(localizationStrings, \"privacy_considerations\")) {\n // We can't check for headers unless we also have a translation\n const msg = `Cannot check for required sections as translations are not available.`;\n const hint = `File an issue to add translations or use a supported language.`;\n showWarning(msg, name, { hint });\n return;\n }\n\n if (conf.noRecTrack || !requiresSomeSectionStatus.has(conf.specStatus)) {\n return;\n }\n\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n const missingRequiredSections = new InsensitiveStringSet([\n l10n.privacy_considerations,\n l10n.security_considerations,\n ]);\n\n /** @type {NodeListOf<HTMLElement>} */\n const headers = document.querySelectorAll(\"h2, h3, h4, h5, h6\");\n for (const header of headers) {\n const clone = header.cloneNode(true);\n // section number and self-link anchor\n clone.querySelectorAll(\"bdi\")?.forEach(elem => elem.remove());\n const text = norm(clone.textContent);\n if (missingRequiredSections.has(text)) {\n missingRequiredSections.delete(text);\n // Check if we find them all...\n if (missingRequiredSections.size === 0) {\n return; // All present, early return!\n }\n }\n }\n\n // Show the ones we didn't find individually\n for (const title of missingRequiredSections) {\n logger(l10n.msg(title), name, {\n hint: l10n.hint(title),\n });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"wpt-tests-exist\".\n * Warns about nonexistent web platform tests.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"wpt-tests-exist\";\nexport const name = \"core/linter-rules/wpt-tests-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"The following test could not be found in Web Platform Tests:\",\n hint: \"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const filesInWPT = await getFilesInWPT(conf.testSuiteURI, conf.githubAPI);\n if (!filesInWPT) {\n return;\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n for (const elem of testables) {\n elem.dataset.tests\n .split(/,/gm)\n .map(test => test.trim().split(\"#\")[0])\n .filter(test => test && !filesInWPT.has(test))\n .map(missingTest => {\n showWarning(`${l10n.msg} \\`${missingTest}\\`.`, name, {\n hint: l10n.hint,\n elements: [elem],\n });\n });\n }\n}\n\n/**\n * @param {string} testSuiteURI\n * @param {string} githubAPIBase\n */\nasync function getFilesInWPT(testSuiteURI, githubAPIBase) {\n let wptDirectory;\n try {\n const testSuiteURL = new URL(testSuiteURI);\n if (\n testSuiteURL.pathname.startsWith(\"/web-platform-tests/wpt/tree/master/\")\n ) {\n const re = /web-platform-tests\\/wpt\\/tree\\/master\\/(.+)/;\n wptDirectory = testSuiteURL.pathname.match(re)[1].replace(/\\//g, \"\");\n } else {\n wptDirectory = testSuiteURL.pathname.replace(/\\//g, \"\");\n }\n } catch (error) {\n const msg = \"Failed to parse WPT directory from testSuiteURI\";\n showWarning(msg, `linter/${name}`);\n console.error(error);\n return null;\n }\n\n const url = new URL(\"web-platform-tests/wpt/files\", `${githubAPIBase}/`);\n url.searchParams.set(\"path\", wptDirectory);\n\n const response = await fetch(url);\n if (!response.ok) {\n const error = await response.text();\n const msg =\n \"Failed to fetch files from WPT repository. \" +\n `Request failed with error: ${error} (${response.status})`;\n showWarning(msg, `linter/${name}`);\n return null;\n }\n /** @type {{ entries: string[] }} */\n const { entries } = await response.json();\n const files = entries.filter(entry => !entry.endsWith(\"/\"));\n return new Set(files);\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} 中不允许使用不安全的URL.`,\n hint: \"请将以下属性更改为 https://:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n","// @ts-check\n/**\n * Lints for accessibility issues using axe-core package.\n */\n\nimport { showError, showWarning } from \"../utils.js\";\n\nexport const name = \"core/linter-rules/a11y\";\n\nconst DISABLED_RULES = [\n \"color-contrast\", // too slow 🐢\n \"landmark-one-main\", // need to add a <main>, else it marks entire page as errored\n \"landmark-unique\",\n \"region\",\n];\n\nexport async function run(conf) {\n if (!conf.lint?.a11y && /** legacy */ !conf.a11y) {\n return;\n }\n const config = conf.lint?.a11y || /** legacy */ conf.a11y;\n\n const options = config === true ? {} : config;\n const violations = await getViolations(options);\n for (const violation of violations) {\n /**\n * We're grouping by failureSummary as it contains hints to fix the issue.\n * For example, with color-constrast rule, it tells about the present color\n * contrast and how to fix it. If we don't group, errors will be repetitive.\n * @type {Map<string, HTMLElement[]>}\n */\n const groupedBySummary = new Map();\n for (const node of violation.nodes) {\n const { failureSummary, element } = node;\n const elements =\n groupedBySummary.get(failureSummary) ||\n groupedBySummary.set(failureSummary, []).get(failureSummary);\n elements.push(element);\n }\n\n const { id, help, description, helpUrl } = violation;\n const title = `a11y/${id}: ${help}.`;\n for (const [failureSummary, elements] of groupedBySummary) {\n const hints = formatHintsAsMarkdown(failureSummary);\n const details = `\\n\\n${description}.\\n\\n${hints}. ([Learn more](${helpUrl}))`;\n showWarning(title, name, { details, elements });\n }\n }\n}\n\n/**\n * @param {object} opts Options as described at https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter\n */\nasync function getViolations(opts) {\n const { rules, ...otherOptions } = opts;\n const options = {\n rules: {\n ...Object.fromEntries(DISABLED_RULES.map(id => [id, { enabled: false }])),\n ...rules,\n },\n ...otherOptions,\n elementRef: true,\n resultTypes: [\"violations\"],\n reporter: \"v1\", // v1 includes a `failureSummary`\n };\n\n let axe;\n try {\n axe = await importAxe();\n } catch (error) {\n const msg = \"Failed to load a11y linter.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n\n try {\n const result = await axe.run(document, options);\n return result.violations;\n } catch (error) {\n const msg = \"Error while looking for a11y issues.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n}\n\n/** @returns {Promise<typeof window.axe>} */\nfunction importAxe() {\n const script = document.createElement(\"script\");\n script.classList.add(\"remove\");\n script.src = \"https://unpkg.com/axe-core@4/axe.min.js\";\n document.head.appendChild(script);\n return new Promise((resolve, reject) => {\n script.onload = () => resolve(window.axe);\n script.onerror = reject;\n });\n}\n\n/** @param {string} text */\nfunction formatHintsAsMarkdown(text) {\n const results = [];\n for (const group of text.split(\"\\n\\n\")) {\n const [msg, ...opts] = group.split(/^\\s{2}/m);\n const options = opts.map(opt => `- ${opt.trimEnd()}`).join(\"\\n\");\n results.push(`${msg}${options}`);\n }\n return results.join(\"\\n\\n\");\n}\n","// @ts-check\n/**\n * Linter rule \"informative-dfn\".\n *\n * Complains if an informative definition is referenced from a normative section.\n */\nimport { docLink, getIntlData, showError, showWarning } from \"../utils.js\";\n\nimport { informativeRefsInNormative } from \"../xref.js\";\n\nconst ruleName = \"informative-dfn\";\nexport const name = \"core/linter-rules/informative-dfn\";\n\nconst localizationStrings = {\n en: {\n msg(term, cite) {\n return `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Get the source definition to be made normative\n * Add a \\`class=\"lint-ignore\"\\` attribute to the link.\n * Use a local normative proxy for the definition à la \\`<dfn data-cite=\"spec\">term</dfn>\\`\n\n To silence this warning entirely, set \\`lint: { \"${ruleName}\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n informativeRefsInNormative.forEach(({ term, spec, element }) => {\n if (element.classList.contains(\"lint-ignore\")) return;\n logger(l10n.msg(term, spec), name, {\n title: \"Normative reference to non-normative term.\",\n elements: [element],\n hint: l10n.hint,\n });\n });\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","source","position","current","message","kind","level","autofix","ruleName","sliceTokens","count","slice","Math","max","tokensToText","inputs","precedes","text","t","trivia","join","nextToken","type","length","line","precedingLastLine","splitted","split","lastLine","subsequentTokens","subsequentText","sourceContext","repeat","contextType","context","partial","node","hierarchy","unshift","n","base","appendIfExist","contextAsText","bareMessage","sourceName","input","tokens","syntaxError","validationError","token","Base","constructor","Object","defineProperties","writable","toJSON","json","inheritance","proto","descMap","getOwnPropertyDescriptors","key","entries","enumerable","getPrototypeOf","idlTypeIncludesDictionary","idlType","defs","useNullableInner","union","def","unique","typedefIncludesDictionary","cache","reference","dictionary","nullable","subtype","dictionaryIncludesRequiredField","dict","members","field","required","superdict","ArrayBase","Array","super","WrappedToken","static","tokeniser","consumeKind","unescape","write","w","ts","separator","Eof","tokenName","list","parser","listName","extAttrValueSyntax","renamedLegacies","extAttrListItems","syntax","toks","ExtendedAttributeParameters","assign","consume","ret","autoParenter","asterisk","secondaryName","rhsIsList","argument_list","close","rhsType","reference_token","p","identifier","SimpleExtendedAttribute","params","parse","defineProperty","rhs","arguments","validate","extAttr","arg","extendedAttribute","extendedAttributeReference","ExtendedAttributes","push","unconsume","probe","ea","type_suffix","obj","single_type","typeName","Type","return_type","type_with_extended_attributes","keyType","stringTypes","keyIdlType","valueType","generic_type","primitive_type","typeNameKeywords","generic","typ","or","union_type","extAttrs","Boolean","prefix","postfix","filter","typedef","targetToken","firstToken","ref","unescaped","type_body","Default","const_value","expression","const_data","negative","Argument","start_position","optional","variadic","argumentNameKeywords","default","autofixOptionalDictionaryDefaultValue","indexOf","a","isLastRequiredArgument","getFirstToken","name_token","data","Tokeniser","Operation","special","regular","termination","argument","body","definition","nameless","Attribute","noInherit","readonly","startsWith","allowDangler","first","items","item","num_type","integer_type","decimal_type","voidToken","stringifier","getLastIndentation","str","lines","match","autofixAddExposedWindow","exposed","existing","test","values","x","y","isArray","tokenRe","decimal","integer","string","whitespace","comment","other","nonRegexTerminals","concat","punctuations","reserved","idl","lastCharIndex","nextChar","charAt","attemptTokenMatch","noFlushTrivia","currentTrivia","pop","lastIndex","WebIDLParseError","punctuation","re","exec","tokenise","probeKind","candidates","consumeIdentifier","EnumValue","Enum","v","Includes","mixin","Typedef","CallbackFunction","Container","instance","inheritable","allowedMembers","colon","mem","member","m","Constant","IterableLike","secondTypeRequired","secondTypeAllowed","argumentAllowed","argsOpen","argsClose","Constructor","static_member","Interface","every","oldConstructors","autofixConstructor","factoryFunctions","named","constructors","i","opNames","ops","getOperations","statics","Set","op","nonstatics","groupOperationNames","partials","mixins","mixinMap","ext","additions","checkAdditions","forEach","add","existings","addition","checkInterfaceMemberDuplication","interfaceDef","constructorExtAttr","indentation","memberIndent","parentTrivia","indentCh","getMemberIndentation","constructorOp","existingIndex","array","predicate","reverse","findIndex","findLastIndex","splice","removed","trim","Mixin","Field","Dictionary","Namespace","CallbackInterface","parseByTokens","interface_","opts","productions","production","res","eof","concrete","definitions","noop","templates","Writer","raw","wrapper","bind","id","getMixinMap","include","validateIterable","ast","duplicates","groupDefinitions","dup","checkDuplicatedNames","flat","it","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","paramName","paramValue","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","_","fromCharCode","parseInt","substring","caret","edit","regex","opt","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","href","prot","decodeURIComponent","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","splitCells","tableRow","cells","offset","escaped","curr","invert","l","suffLen","currChar","repeatString","pattern","outputLink","cap","link","lexer","title","state","inLink","inlineTokens","Tokenizer","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","matchIndentInNode","indentInNode","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","istask","ischecked","indent","blankLine","endsWithBlankLine","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","itemRegex","trimLeft","search","nextBulletRegex","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","hasMultipleLineBreaks","pre","tag","table","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","create","inlineQueue","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parseInline","l2","l3","cell","itemBody","renderers","Hooks","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","prevRenderer","prevTokenizer","prevHook","passThroughHooks","lexInline","globalThis","global","module","pluralizeExports","exports","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","r","delete","configurable","o","s","WeakSet","u","insertBefore","selected","selectedIndex","f","querySelectorAll","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","g","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","TypeError","parserMode","inputArray","from","char","trimEnd","fromEntries","parseMimeType","parameters","essence","mimeType","size","paramStr","_pluralize","webidl2","_webidl2","reindent","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","xmlEscape","norm","getIntlData","localizationStrings","getIntlDataForKey","concatDate","date","sep","format","runTransforms","flist","funcArgs","methods","meth","showWarning","fetchAndCache","maxAge","Request","cachedResponse","caches","Date","headers","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","toISOString","cacheResponse","Response","blob","put","htmlJoinComma","joined","htmlJoinAnd","addHashId","hash","imul","hashString","addId","pfx","txt","noLC","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","getPreviousSections","sections","previous","previousElementSibling","iteratePreviousElements","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","getCanonicalKey","existingKey","find","makeSafeCopy","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","elements","markAsOffending","details","showError","pluginName","toMDCode","codedJoinOr","quotes","addQuotes","codedJoinAnd","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$p","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$D","group","style$1","github$1","dataInclude","reindent$1","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","tables","webidl","biblio$1","linkToDfn","xref","dataCite","renderBiblio","dfnIndex","contrib","fixHeaders","webidlIndex","structure","informative","idHeaders","caniuse","mdnAnnotation","saveHtml","searchSpecref","searchXref","aboutRespec","seo$1","seo","webidlClipboard","dataTests","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","webMonetization","beforeSave","checkCharset","checkPunctuation","checkInternalSlots","localRefsExist","noCaptionlessTables","noUnusedDfns","noHeadinglessSections","noUnusedVars","requiredSections","wptTestsExist","noHttpProps","a11y","informativeDfn","ReSpec.run","hasLink","isLegacyFrag","getGroupDetails","shortname","wgId","wg","patentURI","wgPatentURI","patentPolicy","wgPatentPolicy","groupType","wgURI","status","groupDetails","groups","getMultipleGroupDetails","showLink","class","showLinkData","showLogo","logo","alt","height","width","until","es","ko","ja","zh","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","reduce","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","extras","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","archives","author","authors","commit_history","edited_in_place","editor","editors","feedback","former_editor","former_editors","history","implementation_report","latest_editors_draft","latest_published_version","latest_recommendation","message_topic","more_details_about_this_doc","multiple_alternates","prev_editor_draft","prev_recommendation","prev_version","publication_history","test_suite","this_version","with_subject_line","your_topic_here","nl","getSpecSubTitleElem","specSubTitleElem","subtitle","headersTmpl","logos","specType","isCR","isCRY","longStatus","textStatus","prependW3C","specStatus","dashDate","publishDate","modificationDate","renderSpecTitle","localStorage","getItem","thisVersion","latestVersion","edDraftURI","historyURI","github","commitHistoryURL","testSuiteURI","implementationReportURI","prevED","showPreviousVersion","prevVersion","prevRecURI","isRec","formerEditors","wgPublicList","renderFeedback","errata","otherLinks","shortName","alternateFormats","multipleAlternates","alternatesHTML","existingCopyright","isUnofficial","licenseInfo","copyrightStart","publishYear","additionalCopyrightHolders","short","linkLicense","renderOfficialCopyright","renderCopyright","repoURL","issuesURL","newIssuesURL","pullsURL","fullName","mailToURL","subject","subjectPrefix","mailingListLink","subjectLine","emailSubject","archiveURL","archiveLink","cgbgHeadersTmpl","specTitleElem","specTitleElemClone","isCGFinal","sotd","status_at_publication","processLink","sotdTmpl","isPreview","renderPreview","additionalContent","renderIsUnofficial","isTagFinding","isNoTrack","isMO","renderIsNoTrack","isMemberSubmission","teamComment","getUTCFullYear","submissionCommentNumber","patentPolicyURL","noteForMemberSubmission","noteForSubmission","sotdAfterWGinfo","overrideStatus","changes","revisionTypes","pa","pc","ca","cc","track","status2track","wgHTML","linkToWorkingGroup","updateableRec","revisedRecEnd","reviewTarget","renderIsRec","statusExplanation","reviewPolicy","endorsement","updatePolicy","lsUpdatePolicy","pubMode","humanPREnd","humanCREnd","crEnd","prEnd","renderNotRec","isNote","isRegistry","multipleWGs","wgPatentHTML","producers","renderDeliverer","additionalSections","prUrl","prNumber","cgbgSotdTmpl","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","renderPublicList","issueBase","linkToCommunity","w3Url","status2maturity","LS","LD","FPWD","status2text","DNOTE","NOTE","STMT","MO","ED","WD","CR","CRD","PR","PER","REC","DISC","RSCND","DRY","CRYD","CRY","RY","unofficial","UD","finding","status2long","W3CNotes","recTrackStatus","registryTrackStatus","tagStatus","cgStatus","bgStatus","cgbgStatus","trStatus","noTrackStatus","licenses","patentPolicies","validateDateAndRecover","fallbackDate","isFinite","formattedDate","collectSotdContent","sotdClone","hasChildNodes","isBasic","isCGBG","isCRDraft","isEd","isPER","isPR","isRecTrack","isRegular","isTagEditorFinding","license","lCaseLicense","deriveLicenseInfo","lastModified","pubSpace","derivePubSpace","maturity","docVersion","reportType","latestVersionURL","validateCGBG","validateIfAllowedOnTR","latestPath","previousPublishDate","previousMaturity","prevMaturity","pubDate","prevPubDate","prevRecShortname","uri","publishISODate","shortISODate","policies","policy","validatePatentPolicies","canShowHistory","historyURL","deriveHistoryURI","wgPotentialArray","idx","isPr","perEnd","contains","noRecTrack","notAllowed","mailToWGPublicList","populateSoTD","generatedSubtitle","coreDefaults","lint","highlightVars","addSectionLinks","w3cLogo","memSubmissionLogo","w3cDefaults","doJsonLd","excludeGithubLinks","supportedStatus","validateStatusForGroup","isWgStatus","inWorkingGroup","doesNotNeedWG","processLogos","css$n","noReSpecCSS","attachFixupScript","resourceHints","createResourceHints","canonicalStatus","styleFile","canUseW3CStyle","noToc","finalStyleURL","linkURL","urls","frag","nextLink","linkCSS","exportDoc","w3cStyle","resolveGithubPromise","rejectGithubPromise","file_a_bug","participate","ghURL","tempURL","org","repo","branch","newProps","githubToken","githubUser","atRiskBase","pullBase","githubAPI","hostname","otherLink","normalizedGHObj","apiBase","normalizedConfig","DOMBuilder","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","includeId","default_title","h1Elem","isConnected","tempElem","documentTitle","setDocumentTitle","isInteger","searchString","findAbstract","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","renderParent","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","promisesToAdd","flatMap","isInDB","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","terms","processConformance","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$l","makeTitle","num","report","number","div","inAside","exampleTitle","css$j","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","decorateTableOfFigures","list_of_tables","listOfTables","decorateTable","tableId","listOfTablesCaption","getListOfTablesListItem","collectTables","listOfTablesElement","decorateListOfTables","topLevelEntities","findDfn","defn","findNormalDfn","findOperationDfn","resolvedName","dfns","getDfns","alternativeDfns","decorateDfn","dfnElem","idlAst","lCaseParent","last","getDataType","local","exportable","addAlternativeNames","asQualifiedName","asMethodName","asFullyQualifiedName","asMethodWithArgs","operationName","argsAst","operationNames","isOptional","requiredArgs","requiredOperation","optionalOps","generateMethodNamesWithArgs","getAlternativeNames","originalName","foundDfns","dfnForArray","closestDfnFor","idlStruct","copyButton","createButton","addCopyIDLButton","idlHeader","idlText","clipboard","writeText","css$h","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","isDefaultJSON","unlinkedAnchor","nameResolverMap","getDefnName","getIdlId","resolvePartial","overload","qualifiedName","fullyQualifiedName","resolveOverload","resolveNameAndId","topLevelIdlTypes","renderWebIDL","idlElement","highlights","closestCite","cites","addIDLHeader","idls","astArray","validations","validation","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","STORE_NAME","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","queries","cachedData","lastChecked","setItem","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","query","cursor","profiles","informativeRefsInNormative","getRequestEntry","getTermFromElement","specs","dataciteElem","closestSection","inlineRefs","higherPriority","uniqueSpecs","dedupeSpecContext","getSpecContext","types","getTypeContext","dataXrefForElem","getForContext","addDataCite","normative","closestNormative","closestInform","addToReferences","objectHash","buffer","TextEncoder","crypto","subtle","digest","bufferToHexString","Uint8Array","padStart","invalidProfileError","profile","normalizeConfig","bodyCite","externalDFNs","findExplicitExternalLinks","queryKeys","apiUrl","uniqueIds","uniqueQueryKeys","resultsFromCache","termsToLook","fetchedResults","fetchFromNetwork","cacheXrefData","getData","ambiguous","notFound","collector","getPrefilledFormURL","howToFix","howToCiteURL","originalTerm","formUrl","specsString","forParent","showErrors","addDataCiteToTerms","css$f","headingExternal","headlingLocal","dfnOf","CODE_TYPES","getLocalTermType","ds","getLocalTermParentContext","getLocalTermSuffix","appendSectionNumbers","secNum","getSectionNumber","collectExternalTerms","uniqueReferences","uniqueID","renderExternalTermEntry","typeSuffix","TYPE_TERMS","TYPED_TYPES","linkForText","getTermText","styleEl","localTermIndex","dataSortedByTerm","collectLocalTerms","renderItem","suffix","getLocalTermText","renderLocalTerm","createLocalTermIndex","externalTermIndex","dataSortedBySpec","specA","specB","createExternalTermIndex","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","showContributors","getParents","idlIndexSec","idlIndex","lowerHeaderTags","toc","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","css$d","BROWSERS","statToText","defaultBrowsers","DEFAULTS","removeOnSave","browsers","feature","normalizeCaniuseConf","invalidBrowsers","browser","validateBrowsers","featureURL","headDlElem","contentPromise","statusText","fetchStats","toBrowserCell","browserId","browserName","supportLevel","cssClass","textVersion","getLogoSrc","browserCellRenderer","processJson","handleError","definitionPair","outputDoc","css$b","BASE_JSON_PATH","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","opera","opera_android","safari","safari_ios","samsunginternet_android","webview_android","inAllEngines","inSomeEngines","insertMDNBox","targetAncestor","targetSibling","mdnBox","attachMDNDetail","mdnSpec","summary","support","engines","mdnSubPath","engineSupport","getEngineSupportIcons","getEngineSupport","createRow","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","getMdnData","findElements","mdnSpecArray","save_snapshot","downloadLinks","epubURL","saveDialog","filename","toDownloadLink","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","status2rdf","LC","requiresCanonicalLink","addPerson","ed","worksFor","addRef","jsonld","creator","publishedDate","isbn","canonicalURI","rdfStatus","w3p","foaf","datePublished","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","description","contributor","citationIds","citationContents","citation","addJSONLDInfo","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","handleDuplicates","testURLs","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","css$5","varMap","variables","currentSection","textNode","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","monetization","paymentPointer","rawConfig","canonicalizeConfig","transforms","pos","performTransformations","metas","meta","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLTableCaptionElement","isDfnUnused","logger","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","sectionTitle","privacy_considerations","security_considerations","requiresSomeSectionStatus","missingRequiredSections","filesInWPT","githubAPIBase","wptDirectory","testSuiteURL","files","getFilesInWPT","missingTest","offendingMembers","getOwnPropertyNames","DISABLED_RULES","formatHintsAsMarkdown","violations","otherOptions","enabled","elementRef","resultTypes","reporter","axe","onload","onerror","importAxe","getViolations","violation","groupedBySummary","nodes","failureSummary","help","helpUrl","hints"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAAO,CAAEC,YACjDnB,OAAOsB,SAAWtB,OAAOuB,KAC3B,OAGF,MAAMC,EAAOC,OAAOC,KAAKC,UAAUR,GAAQS,OAAST,IACpDnB,OAAOsB,OAAOO,YAAY,CAAEX,QAAOM,QAAQxB,OAAOsB,OAAOQ,SAASC,OACpE,CAWO,SAASC,EAAId,EAAOe,EAAIC,EAAU,CAAEC,MAAM,IAE/CpB,EAAcqB,iBAAiBlB,GADdmB,GAAKJ,EAAGI,EAAElB,SACqBe,EAClD,CAEAtB,EAnCoB,iBAmCP,CAAEoB,QCpCf,MAAMM,EAAa,CAAC,cAAe,cCG5B,MAEDC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AQ,SAAU6V,GAClB,OAAOR,EAAU0B,cAAclB,EAAK,GAAIA,EAAK,GAClD,IAKG,CACE,CAAC,MAAO,IACR,CAAC,SAAU,MACX,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACV7V,SAAQ,SAAU6V,GAClB,OAAOR,EAAU4B,gBAAgBpB,EAAK,GAAIA,EAAK,GACpD,IAKG,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACA7V,QAAQqV,EAAU6B,oBAEb7B,CACV,IAGA,IAAIA,GAAYH,GCjgBsBmC,GAAU,SAASC,GAAgB,IAAIvoB,EAAE,CAAE,EAAC,IA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A2B6R,oDAAuD7R,MAEvFx4B,WACF,OAAOkI,EAAO;;;;;;;2DAOuChgC,0CACtD,sDAKE,SAAailC,GAClB,IAAKA,EAAK4b,OAAO7gD,IAAW,OAC5B,MAAM08E,EAAiC,UAAxBz3C,EAAK4b,KAAK7gD,IAAwBy/B,GAAY1F,GAE7D8pC,GAA2BlyD,SAAQ,EAAGwwD,OAAM9R,OAAMpzB,cAC5CA,EAAQ9E,UAAUmoB,SAAS,gBAC/Bo8B,EAAO9iF,GAAK4rB,IAAI28C,EAAM9R,GAAOz4D,GAAM,CACjCoiB,MAAO,6CACPslB,SAAU,CAACrC,GACXnF,KAAMl+B,GAAKk+B,MACX,GAEN","x_google_ignoreList":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,40]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a4ca0c16dc..f86b0a4733 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "respec", - "version": "32.8.0", + "version": "32.8.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "respec", - "version": "32.8.0", + "version": "32.8.1", "license": "W3C", "dependencies": { "colors": "1.4.0", diff --git a/package.json b/package.json index 1293b6f392..a6847802ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "respec", - "version": "32.8.0", + "version": "32.8.1", "license": "W3C", "description": "A technical specification pre-processor.", "engines": {