diff --git a/builds/respec-aom.js b/builds/respec-aom.js index 034b57e43a..ab118b559b 100644 --- a/builds/respec-aom.js +++ b/builds/respec-aom.js @@ -1,7 +1,6 @@ -window.respecVersion="33.0.2",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` +window.respecVersion="33.0.3",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"),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]=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;function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge,be={exports:{}};ge=be,function(e,t){ge.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 ye=me(be.exports),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>>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 Se=Object.freeze({__proto__:null,name:"core/reindent",reindent:Ee,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Ee(e.innerHTML)}});const Ce=/-/g,Ae=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Le="en"===l||l.startsWith("en-")?"en-AU":l,Te=new Intl.DateTimeFormat(Le,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Le?"2-digit":"numeric"});function Re(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 Ne(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Oe(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 De=Oe("conjunction"),Ie=Oe("disjunction");function Pe(e,t){return De(e,t).join("")}function je(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 Me(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){tt(`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=>ve`${e}, `));return ve`${r}${n[n.length-1]}`}function Fe(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 Be(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 He(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 Ue(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Ve(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 Ze(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 Ge 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 Ye(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{He(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ke(t),t}function Ke(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Qe(t)])e.remove()}function*Qe(e){for(;e.nextNode();)yield e.currentNode}class Xe 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 Je 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||Fe(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 et(e,t,n={}){const o={...n,isWarning:!1};r("error",new Je(e,t,o))}function tt(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Je(e,t,o))}function nt(e){return e?`\`${e}\``:""}function rt(e,{quotes:t}={quotes:!1}){return Ie(e,t?e=>{return nt((t=e,String(t)?`"${t}"`:""));var t}:nt).join("")}function ot(e,...t){return Ee(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 it=new Map([["text/html","html"],["application/xml","xml"]]);function st(e,t=document){const n=it.get(e);if(!n){const t=[...it.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=at(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function at(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ke(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Ne(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=ve``);i.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=ve` - `;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} + `;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:st});class lt{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 at("html",document)}}const ct="core/post-process";const ut="core/pre-process";const dt="core/base-runner";async function pt(e){!function(){const e=new lt;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(`${dt}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||et("Every item in `preProcess` must be a JS function.",ut),t})).map((async t=>{try{return await t(e,document)}catch(e){et(`Function ${t.name} threw an error during \`preProcess\`.`,ut,{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||et("Every item in `postProcess` must be a JS function.",ct),t})).map((async t=>{try{return await t(e,document)}catch(e){et(`Function ${t.name} threw an error during \`postProcess\`.`,ct,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Ne(document),performance.mark(`${dt}-end`),performance.measure(dt,`${dt}-start`,`${dt}-end`)}var ft=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 +64,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 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`
    ${e}
    `;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("
    ",`
    `)}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,mt=/&/gm;class gt extends ke.Renderer{code(e,t,n){const{language:r,...o}=gt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`
    ${e}
    `;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("
    ",`
    `)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw`
           
    ${n}
    ${t}
    - `}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`${n}`}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 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``,_t=we`
      ${n}`}return super.heading(e,t,n,r)}}const bt={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new gt};function yt(e,t={inline:!1}){const n=Ee(e).replace(ht,">").replace(mt,"&");return t.inline?ke.parseInline(n,bt):ke.parse(n,bt)}function wt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=yt(e.innerHTML)}const vt=(xt="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(xt);return t.forEach(wt),Array.from(t)});var xt;var kt=Object.freeze({__proto__:null,markdownToHtml:yt,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 vt(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=Ze(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 $t(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=ft,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const _t=ve``,Et=ve``,Et=we`
    `,St=ve``;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``;function Ot(){Et.classList.toggle("respec-hidden"),Et.classList.toggle("respec-visible"),Et.hidden=!Et.hidden}function Dt(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(Nt),Nt.addEventListener("click",(e=>{e.stopPropagation(),Nt.setAttribute("aria-expanded",String(Et.hidden)),Ot(),Et.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{Et.hidden||Ot()})),_t.appendChild(Et),Et.addEventListener("keydown",(e=>{"Escape"!==e.key||Et.hidden||(Nt.setAttribute("aria-expanded",String(Et.hidden)),Ot(),Nt.focus())}));const It=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Pt(e,t,n,r){t.push(e),Rt.hasOwnProperty(n)||(Rt[n]=function(e,t,n){const r=ve``;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``;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=ve`
        `;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)}jt.freshModal(n,o,r)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return $t(r,o),r}(n,t,r),_t.appendChild(Rt[n]));const o=Rt[n];o.textContent=t.length;const i=1===t.length?_e.singular(r):r;$t(o,new Map([["label",`${t.length} ${i}`]]))}$t(Nt,It);const jt={show(){try{_t.hidden=!1}catch(e){console.error(e)}},hide(){_t.hidden=!0},enable(){Nt.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=ve``,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`
        `,s=ve`
      3. ${i}
      4. `;return s.addEventListener("click",t),Et.appendChild(s),i},error(e){Pt(e,Lt,"error","ReSpec Errors")},warning(e){Pt(e,Tt,"warning","ReSpec Warnings")},closeModal(e){At&&(At.classList.remove("respec-show-overlay"),At.classList.add("respec-hide-overlay"),At.addEventListener("transitionend",(()=>{At.remove(),At=null}))),e&&e.setAttribute("aria-expanded","false"),Ct&&(Ct.remove(),Ct=null,Nt.focus())},freshModal(e,t,n){Ct&&Ct.remove(),At&&At.remove(),At=ve`
        `;const r=`${n.id}-modal`,o=`${r}-heading`;Ct=ve``;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{ +
        `;const i=new Map([["labelledby",o]]);$t(Ct,i),document.body.append(At,Ct),At.addEventListener("click",(()=>this.closeModal(n))),At.classList.toggle("respec-show-overlay"),Ct.hidden=!1,Dt(Ct)}};function zt(e){if("string"==typeof e)return e;const t=e.plugin?`

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

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

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

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

        \n ${yt(e.elements.map(Mt).join("\n"))}`:"",o=e.details?`\n\n
        \n${e.details}\n
        \n`:"";return`${yt(`**${e.message}**`,{inline:!0})}${n}${r}${o}${t}`}function Mt(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 pt(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 Ft=[Promise.resolve().then((function(){return Bt})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Vt})),Promise.resolve().then((function(){return Yt})),Promise.resolve().then((function(){return Xt})),Promise.resolve().then((function(){return an})),Promise.resolve().then((function(){return kt})),Promise.resolve().then((function(){return Se})),Promise.resolve().then((function(){return un})),Promise.resolve().then((function(){return _n})),Promise.resolve().then((function(){return Cn})),Promise.resolve().then((function(){return An})),Promise.resolve().then((function(){return Rn})),Promise.resolve().then((function(){return qr})),Promise.resolve().then((function(){return Wr})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return so})),Promise.resolve().then((function(){return po})),Promise.resolve().then((function(){return bo})),Promise.resolve().then((function(){return vo})),Promise.resolve().then((function(){return ar})),Promise.resolve().then((function(){return qo})),Promise.resolve().then((function(){return To})),Promise.resolve().then((function(){return yr})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return nn})),Promise.resolve().then((function(){return Ho})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return Jo})),Promise.resolve().then((function(){return ti})),Promise.resolve().then((function(){return si})),Promise.resolve().then((function(){return pi})),Promise.resolve().then((function(){return fi})),Promise.resolve().then((function(){return vi})),Promise.resolve().then((function(){return Ei})),Promise.resolve().then((function(){return Ri})),Promise.resolve().then((function(){return Oi})),Promise.resolve().then((function(){return Ii})),Promise.resolve().then((function(){return Hi})),Promise.resolve().then((function(){return Vi})),Promise.resolve().then((function(){return Xi})),Promise.resolve().then((function(){return ts})),Promise.resolve().then((function(){return is})),Promise.resolve().then((function(){return cs})),Promise.resolve().then((function(){return ps})),Promise.resolve().then((function(){return ms})),Promise.resolve().then((function(){return ys})),Promise.resolve().then((function(){return xs}))];Promise.all(Ft).then((e=>qt(e))).catch((e=>console.error(e)));var Bt=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 Ht={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([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),Ut={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 Vt=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...Ht.lint,...Ut.lint,...e.lint};Object.assign(e,{...Ht,...Ut,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:Wt.get(e.license)}}(e))}});var Zt=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 +149,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 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`

        `;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 Gt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Zt,document.head.appendChild(e),e}();var Yt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Gt.remove()}});const Kt="aom/style";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:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(Re))t.appendChild(n);return t}();Qt.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]")||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:Kt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",tt(t,Kt)}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 Jt{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(en(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function en(e){const t=new Jt(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 tn(e){const t=en(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 nn=Object.freeze({__proto__:null,name:"core/sections",restructure:tn,run:function(){tn(document.body)}});const rn="core/data-include";function on(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=Me(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=yt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&tn(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 sn(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);on(await o.text(),r,n),t<3&&await sn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),et(r,rn,{elements:[e]})}}));await Promise.all(r)}var an=Object.freeze({__proto__:null,name:rn,run:async function(){await sn(document,1)}});const ln="core/title",cn=ze({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var un=Object.freeze({__proto__:null,name:ln,run:function(e){const t=document.querySelector("h1#title")||ve`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){et('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">`.',ln,{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||`${cn.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}=ve` 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` + `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function dn(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return tt(t,"core/templates/show-link"),void console.warn(t,e)}return ve` <dt class="${e.class?e.class:null}">${e.key}</dt> - ${e.data?e.data.map(dn):dn(e)} - `}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 fn(e,t){const n=we`<a href="${e.url||null}" class="logo" + ${e.data?e.data.map(pn):pn(e)} + `}function pn(e){return ve`<dd class="${e.class?e.class:null}"> + ${e.href?ve`<a href="${e.href}">${e.value||e.href}</a>`:e.value} + </dd>`}const fn="core/templates/show-logo";function hn(e,t){const n=ve`<a href="${e.url||null}" class="logo" ><img alt="${e.alt||null}" crossorigin @@ -166,7 +165,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=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 + </a>`;if(!e.alt){const r=ot`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;et(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,fn,{hint:r,elements:[n]})}if(!e.src){const e=ot`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;et(`Logo at index ${t} is missing "\`src\`" property.`,fn,{hint:e,elements:[n]})}return n}const mn="core/templates/show-people",gn=ze({en:{until:e=>ve` Until ${e} `},es:{until:e=>ve` Hasta ${e} `},ko:{until:e=>ve` ${e} 이전 `},ja:{until:e=>ve` ${e} 以前 `},de:{until:e=>ve` bis ${e} `},zh:{until:e=>ve` 直到 ${e} `}});function bn(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 et(`${i} Missing required property \`"name"\`.`,mn,{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 et(n,mn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return et(`${i} ORCID "${o}" has wrong format.`,mn,{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 et(`${i} ORCID "${n}" failed checksum check.`,mn,{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())?(et(`${i} The property "\`retiredDate\`" is not a valid date.`,mn,{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 et(`${n}. Member "extra" at index ${r} is not an object.`,mn,{hint:t}),!1;case!e.hasOwnProperty("name"):return et(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,mn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return et(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,mn,{hint:t}),!1}return!0})):(et(`${n}. A person's "extras" member must be an array.`,mn,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&tt(`${i} Has both "url" and "mailto" property.`,mn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&tt(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,mn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var s});var o;return n.filter(r).map(yn)}function yn(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(ve`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(ve`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(ve`<a class="p-name orcid" href="${e.orcid}">${ve`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" @@ -185,15 +184,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?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(we` - ${mn.until(e)} `)}return we`<dd +</svg>`}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?ve`<a class="${t}" href="${e.companyURL}">${n}</a>`:ve`<span class="${t}">${n}</span>`;o.push(ve` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>ve`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?ve`<a href="${r}" class="${t}">${n}</a>`:ve`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:i}=e;if(e.retiredDate){const e=ve`<time datetime="${i}" + >${Te.format(new Date(i))}</time + >`;o.push(ve` - ${gn.until(e)} `)}return ve`<dd class="editor p-author h-card vcard" data-editor-id="${r}" > ${o} - </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):""} + </dd>`}const wn=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 vn=e=>ve`<div class="head"> + ${"PD"!==e.specStatus?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} - @@ -202,29 +201,29 @@ dd{margin-left:0} > </h2> <dl> - <dt>${yn.this_version}</dt> + <dt>${wn.this_version}</dt> <dd> <a class="u-url" href="${e.thisVersion}">${e.thisVersion}</a> </dd> - <dt>${yn.issue_tracker}</dt> + <dt>${wn.issue_tracker}</dt> <dd> <a class="u-url" href="${e.issueTracker}">${e.issueTracker}</a> </dd> - <dt>${e.multipleEditors?yn.editors:yn.editor}</dt> - ${gn(e,"editors")} - ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?we` + <dt>${e.multipleEditors?wn.editors:wn.editor}</dt> + ${bn(e,"editors")} + ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?ve` <dt> - ${e.multipleFormerEditors?yn.former_editors:yn.former_editor} + ${e.multipleFormerEditors?wn.former_editors:wn.former_editor} </dt> - ${gn(e,"formerEditors")} + ${bn(e,"formerEditors")} `:""} - ${e.authors?we` - <dt>${e.multipleAuthors?yn.authors:yn.author}</dt> - ${gn(e,"authors")} + ${e.authors?ve` + <dt>${e.multipleAuthors?wn.authors:wn.author}</dt> + ${bn(e,"authors")} `:""} - ${e.otherLinks?e.otherLinks.map(un):""} + ${e.otherLinks?e.otherLinks.map(dn):""} </dl> - ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;return we`<p class="copyright"> + ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;return ve`<p class="copyright"> Copyright ${e.publishYear}, <a href="https://www.w3.org/" ><abbr title="The Alliance for Open Media">AOM</abbr></a @@ -245,62 +244,62 @@ 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=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 + </div>`;const xn="aom/headers",kn={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},$n=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var _n=Object.freeze({__proto__:null,name:xn,run:function(e){if(!e.specStatus){et("Missing required configuration: `specStatus`",xn)}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=Ae.format(r);return new Date(e)}return et(`[\`${t}\`](https://github.com/w3c/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,xn),new Date(Ae.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=$n.format(e.publishDate);const t=function(e){if(!e.name){et("All authors and editors must have a name.",xn)}};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){et("At least one editor is required",xn)}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=kn[e.specStatus],e.dashDate=Ae.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=vn(e);document.body.prepend(n),document.body.classList.add("h-entry"),r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const En="aom/abstract",Sn=ze({en:{abstract:"Abstract"}});var Cn=Object.freeze({__proto__:null,name:En,run:async function(){const e=document.getElementById("abstract");if(!e){return void et('Document must have one element with `id="abstract"',En)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=Sn.abstract,e.prepend(t))}});var An=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Me(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Ln="core/dfn-abbr";function Tn(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 Rn=Object.freeze({__proto__:null,name:Ln,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Tn(t);else{et(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Ln,{elements:[t],title:"Error: unsupported."})}}}});const Nn=/^[a-z]+(\s+[a-z]+)+\??$/,On=/\B"([^"]*)"\B/,Dn=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,In=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Pn=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,jn=/^(?:\w+)\??$/,zn=/^(\w+)\["([\w- ]*)"\]$/,Mn=/\.?(\w+\(.*\)$)/,qn=/\/(.+)/,Fn=/\[\[.+\]\]/;function Bn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return ve`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></a - >`}function Bn(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:s}=n||{},a="method"===r,l=a?we`(${Me(i,Hn)})`:null,c=a?`(${i.join(", ")})`:"";return we`${n&&o?".":""}<a + >`}function Hn(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:s}=n||{},a="method"===r,l=a?ve`(${qe(i,Wn)})`:null,c=a?`(${i.join(", ")})`:"";return ve`${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 Hn(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 Wn(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return we`${r?".":""}<a + >`}function Wn(e,t,n){if(t<n.length-1)return ve`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return ve`${o?"...":null}<var>${i}</var>`}function Un(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return ve`${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 Un(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{renderText:s,renderArgs:a}=e,{identifier:l}=o||{},c=Me(a||t,Hn),u=`${n}(${t.join(", ")})`;return we`${o&&i?".":""}<a + >`}function Vn(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,Wn),u=`${n}(${t.join(", ")})`;return ve`${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?we`<code>(${c})</code>`:""}`}function Vn(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return we`"<a + >${!s||a?ve`<code>(${c})</code>`:""}`}function Zn(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return ve`"<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 Zn(e){const{identifier:t}=e;return we`"<a + >"`}function Gn(e){const{identifier:t}=e;return ve`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function Gn(e){const{identifier:t,nullable:n}=e;return we`<a + >"`}function Yn(e){const{identifier:t,nullable:n}=e;return ve`<a data-link-type="idl" data-cite="webidl" 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: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> + >`}function Kn(e){let t;try{t=function(e){const t=Fn.test(e),n=t?qn: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(Dn.test(t)){const[,e,n,r,o]=t.match(Dn),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(On.test(t)){const[,e]=t.match(On);s?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:s})}else if(In.test(t)){const[,e,n]=t.match(In),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(Pn.test(t)&&i.length){const[,e]=t.match(Pn);a.push({type:"attribute",identifier:e,renderParent:s})}else if(Nn.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(!jn.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=ve`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return et(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=ve(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Bn(e);t&&r.push(t);break}case"attribute":r.push(Un(e));break;case"internal-slot":r.push(Hn(e));break;case"method":r.push(Vn(e));break;case"enum":r.push(Zn(e));break;case"exception":r.push(Gn(e));break;case"idl-primitive":r.push(Yn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Qn=new Set(["alias","reference"]),Xn=async function(){const e=await xe.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 Jn={get ready(){return Xn},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)}},er={},tr=new URL("https://api.specref.org/bibrefs?refs="),nr=Re({hint:"dns-prefetch",href:tr.origin});let rr;document.head.appendChild(nr);const or=new Promise((e=>{rr=e}));async function ir(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(tr.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 Jn.addAll(o,e)}catch(e){console.error(e)}return o}async function sr(e){const t=await or;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await sr(n.aliasOf):n}var ar=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=er;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 Jn.ready;const n=e.map((async e=>({id:e,data:await Jn.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=>{er[e.id]=e.data}));const i=o.noData.map((e=>e.id));if(i.length){const e=await ir(i,{forceUpdate:!0});Object.assign(er,e)}Object.assign(er,this.conf.localBiblio),(()=>{rr(this.conf.biblio)})()}},biblio:er,name:"core/biblio",resolveRef:sr,updateFromNetwork:ir});const lr="core/render-biblio",cr=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:"参考文献"}}),ur=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"]]),dr=(pr=".",e=>{const t=e.trim();return!t||t.endsWith(pr)?t:t+pr});var pr;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(hr)),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=ve`<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 + <dl class="bibliography">${i.map(gr)}</dl> + </section>`;Fe(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()));et(`Reference "[${t}]" not found.`,lr,{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 hr(e){let t=er[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;et(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,lr)}else n=t.aliasOf,t=er[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function mr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=ve`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?o:we`[${o}]`}function mr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return we` + >`;return t?o:ve`[${o}]`}function gr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return ve` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:gr(n)}:we`<em class="respec-offending-element" - >${lr.reference_not_found}</em + ${n?{html:br(n)}:ve`<em class="respec-offending-element" + >${cr.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=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 + `}function br(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} ${dr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${ur.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var yr=Object.freeze({__proto__:null,name:lr,renderInlineCitation:mr,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")||ve`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(ve`<h1>${cr.references}</h1>`),r.classList.add("appendix"),n.length){const e=fr(n,cr.norm_references);r.appendChild(e)}if(t.length){const e=fr(t,cr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const wr="core/inlines",vr={},xr=e=>new RegExp(e.map((e=>e.source)).join("|")),kr=ze({en:{rfc2119Keywords:()=>xr([/\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:()=>xr([/\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=/(?:`[^`]+`)(?!`)/,_r=/(?:{{[^}]+\?*}})/,Er=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Sr=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Cr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Ar=/(?:\[=[^=]+=\])/,Lr=/(?:\[\^[^^]+\^\])/;function Tr(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 ve`<code ><a data-xref-type="${i}" data-xref-for="${s}" @@ -308,36 +307,36 @@ 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")?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 + >`}function Rr(e){const t=je(e),n=ve`<em class="rfc2119">${t}</em>`;return vr[t]=!0,n}function Nr(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?ve`<a href="${t}" data-matched-text="${e}"></a>`:ve`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Or(e,t){const n=je(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Kn(n);return!!t.parentElement.closest("dfn")?zr(`\`${r.textContent}\``):r}function Dr(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=mr(o,i),c=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;tt("Normative references in informative sections are not allowed. ",wr,{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 Ir(e,t,n){return"ABBR"===t.parentElement.tagName?e:ve`<abbr title="${n.get(e)}">${e}</abbr>`}function Pr(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return ve`<var data-type="${r}">${n}</var>`}function jr(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 ve`<a data-link-type="dfn" data-link-for="${a}" data-xref-for="${a}" data-lt="${o}" >${s}</a - >`}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> + >`}function zr(e){const t=e.slice(1,-1);return ve`<code>${t}</code>`}function Mr(e){return $r.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?zr(e):Mr(e))):document.createTextNode(e)}var qr=Object.freeze({__proto__:null,name:wr,rfc2119Usage:vr,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ge,e.informativeReferences=new Ge,e.respecRFC2119||(e.respecRFC2119=vr);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=kr.rfc2119Keywords(),s=new RegExp(`(${xr([i,_r,Er,Sr,Cr,Ar,$r,Lr,...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(Or(s,n));break;case s.startsWith("[[["):o.append(Nr(s));break;case s.startsWith("[["):o.append(...Dr(s,n,e));break;case s.startsWith("|"):o.append(Pr(s));break;case s.startsWith("[="):o.append(jr(s));break;case s.startsWith("`"):o.append(zr(s));break;case s.startsWith("[^"):o.append(Tr(s));break;case t.has(s):o.append(Ir(s,n,t));break;case i.test(s):o.append(Rr(s))}else o.append(s);n.replaceWith(o)}}});const Fr="aom/conformance",Br=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)=>ve`<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> - ${hr("RFC2119")} ${hr("RFC8174")} + ${mr("RFC2119")} ${mr("RFC8174")} when, and only when, they appear in all capitals, as shown here. - </p>`}});function Br(e,t){const n=[...Object.keys(wr)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(Oe(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>${Fr.conformance}</h1> - <p>${Fr.normativity}</p> - ${n.length?Fr.keywordInterpretation(r,i):null} - `;e.prepend(...s.childNodes)}var Hr=Object.freeze({__proto__:null,name:qr,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Br(t,e),!t&&Object.keys(wr).length){et("Document uses RFC2119 keywords but lacks a conformance section.",qr,{hint:'Please add a `<section id="conformance">`.'})}}});function Wr(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 Ur(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 Vr=new Qe;function Zr(e,t){for(const n of t)Vr.has(n)||Vr.set(n,new Set),Vr.get(n).add(e)}const Gr="core/dfn",Yr=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Ur}],["element",{requiresFor:!1,validator:Wr}],["element-attr",{requiresFor:!1,validator:Wr}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Ur}],["event",{requiresFor:!1,validator:Ur}],["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:Ur}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Ur(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)}}]]),Kr=[...Yr.keys()];function Qr(e,t){let n="";switch(!0){case Kr.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Yr.has(e))),function(e,t,n){const r=Yr.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,Gr,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,Gr)}(t,n,e);break;case Dn.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.`,Gr,{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,Gr,{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 Xr(e){switch(!0){case e.matches(".export.no-export"):Je(rt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Gr,{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.`,Gr,{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 Jr(){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 eo=Object.freeze({__proto__:null,name:Gr,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Fe(e);if(Zr(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Qr(e,n),Xr(e),1===t.length&&n===Pe(e.textContent)||(e.dataset.lt=t.join("|"))}o("plugins-done",Jr)}});var to=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=Pe(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=Pe(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=Pe(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("|"),Zr(e,n)}}))}});var no=String.raw`span.example-title{text-transform:none} + </p>`}});function Hr(e,t){const n=[...Object.keys(vr)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(De(o,(e=>ve`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?ve`${e}`:e)));var o;const i=n.length>1,s=ve` + <h1>${Br.conformance}</h1> + <p>${Br.normativity}</p> + ${n.length?Br.keywordInterpretation(r,i):null} + `;e.prepend(...s.childNodes)}var Wr=Object.freeze({__proto__:null,name:Fr,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Hr(t,e),!t&&Object.keys(vr).length){tt("Document uses RFC2119 keywords but lacks a conformance section.",Fr,{hint:'Please add a `<section id="conformance">`.'})}}});function Ur(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){et(`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 Vr(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return et(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Zr=new Xe;function Gr(e,t){for(const n of t)Zr.has(n)||Zr.set(n,new Set),Zr.get(n).add(e)}const Yr="core/dfn",Kr=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Vr}],["element",{requiresFor:!1,validator:Ur}],["element-attr",{requiresFor:!1,validator:Ur}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Vr}],["event",{requiresFor:!1,validator:Vr}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new $e(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return et(`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:Vr}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Vr(e.slice(1,-1),t,n,r):(et(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Qr=[...Kr.keys()];function Xr(e,t){let n="";switch(!0){case Qr.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Kr.has(e))),function(e,t,n){const r=Kr.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=ot`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=ot`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;et(e,Yr,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,Yr)}(t,n,e);break;case In.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=ot`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;et(`Internal slot "${e}" must be associated with a WebIDL interface.`,Yr,{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=ot`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${rt(o,{quotes:!0})}. The slot "${e}" seems to be a "${nt(r)}"?`;return et(n,Yr,{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 Jr(e){switch(!0){case e.matches(".export.no-export"):et(ot`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Yr,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){et(ot`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Yr,{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 eo(){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 to=Object.freeze({__proto__:null,name:Yr,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Be(e);if(Gr(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Xr(e,n),Jr(e),1===t.length&&n===je(e.textContent)||(e.dataset.lt=t.join("|"))}o("plugins-done",eo)}});var no=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("|"),Gr(e,n)}}))}});var ro=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 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 +.example pre{background-color:rgba(0,0,0,.03)}`;const oo=ze({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function io(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?ve`<span class="example-title">: ${n.title}</span>`:"";return ve`<div class="marker"> + <a class="self-link">${oo.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> - ${no} - </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=oo(e,t,r);e.prepend(n);const i=qe(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=oo(e,n?0:t,r),a=we`<div class="example" id="${i}"> + </div>`}var so=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(ve`<style> + ${ro} + </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=io(e,t,r);e.prepend(n);const i=Fe(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=io(e,n?0:t,r),a=ve`<div class="example" id="${i}"> ${s} ${e.cloneNode(!0)} - </div>`;qe(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var so=String.raw`.issue-label{text-transform:initial} + </div>`;Fe(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var ao=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} @@ -347,39 +346,39 @@ 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=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 +.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 lo="core/issues-notes",co=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 uo(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?co.feature_at_risk:co.issue:n?co.warning:r?co.editors_note:co.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=ve`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=ve`<div role="heading" class="${`${i}-title marker`}">${c}</div>`;Fe(p,"h",i);let f,h=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):Fe(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 ve`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return ve`<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){tt(`Failed to fetch issue number ${u}.`,lo)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?ve`<span style="text-transform: none">: ${t.title}</span>`:"";return ve`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(co.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 ve` <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 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=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=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=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||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"> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return ve`<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=Ve(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(ve`<p>${co.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${co.issue_summary}</h1>`)}(o)}var po=Object.freeze({__proto__:null,name:lo,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 et(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,lo),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(ve`<style> + ${ao} + </style>`,o.querySelector("link")),uo(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const fo="core/best-practices",ho={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},mo=ze(ho),go=l in ho?l:"en";var bo=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=Fe(e,"bp"),o=ve`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${go}">${mo.best_practice}${t+1}</bdi></a + >`;if(n){const t=ve`<li>${o}: ${Ye(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=ve`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(ve`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){tt("Using best practices summary (#bp-summary) but no best practices found.",fo),t.remove()}}});const yo="core/figures",wo=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 vo=Object.freeze({__proto__:null,name:yo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||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;Fe(e,"fig",r),Ue(t,ve`<span class="fig-title"></span>`),t.prepend(ve`<a class="self-link" href="#${e.id}" + >${wo.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=>{He(e,"span").removeAttribute("href")})),ve`<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"> + </li>`}(t.id,r));else{tt("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(ve`<h1>${wo.list_of_figures}</h1>`,ve`<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=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"> + </ul>`))}});const xo="core/data-cite",ko="__SPEC__";async function $o(e){const{key:t,frag:n,path:r,href:o}=e;let i="",s="";if(t===ko)i=document.location.href;else{const e=await sr(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?Ue(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){et("Exporting an linked external definition is not allowed.",xo,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function Eo(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const So=Eo("#"),Co=Eo("/");function Ao(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?Ao(r):{key:ko,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=n.replace("#",""),Ao(e)}const s=r?`#${r}`:So(n),a=o||Co(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 Lo(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 To=Object.freeze({__proto__:null,THIS_SPEC:ko,name:xo,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(Ao).map((async e=>({entry:e,result:await sr(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await ir(n);r&&Object.assign(er,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Ao(t),r=await $o(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),tt(n,xo,{elements:[t]})}}o("beforesave",Lo)},toCiteDetails:Ao});const Ro="core/link-to-dfn",No=[],Oo={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:"在文档中有重复的定义。"}},Do=ze(Oo);function Io(e){const t=new Map,n=[];for(const r of Zr.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),Fe(r,"dfn",e)}}return{result:t,duplicates:n}}function Po(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Be(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 jo(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||Ue(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 Mo(e){e.forEach((e=>{tt(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,Ro,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var qo=Object.freeze({__proto__:null,name:Ro,possibleExternalLinks:No,run:async function(e){const t=function(){const e=new Xe;for(const t of Zr.keys()){const{result:n,duplicates:r}=Io(t);e.set(t,n),r.length>0&&et(Do.duplicateMsg(t),Ro,{title:Do.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){No.push(e);continue}const r=Po(e,t);if(r){jo(e,r,t)||No.push(e)}else""===e.dataset.cite?n.push(e):No.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}=Ao(t);r!==ko&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Mo(No)}});const Fo="core/contrib";var Bo=Object.freeze({__proto__:null,name:Fo,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void et(ot`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Fo)}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 ve(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 et("Error loading contributors from GitHub.",Fo),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);He(e,`h${t}`)}))}});const Wo=["h2","h3","h4","h5","h6"],Uo="core/structure",Vo=ze({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Zo(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=ve`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=i,r=!0);let e=a.isIntro?"":r?Go(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(ve`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Ko(a.header,n),o=Zo(a.subsections,t,{prefix:e});o&&r.append(o),s.append(r)}}return s}function Go(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Yo(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(!Wo.includes(r.localName))continue;const o=r.textContent;Fe(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Yo(e)})}return n}function Ko(e,t){const n=ve`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=He(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{He(e,"span").removeAttribute("id")})),ve`<li class="tocline">${n}</li>`}var Qo=Object.freeze({__proto__:null,name:Uo,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(Ve(e,"section").length+1,6)}`;e.localName!==t&&He(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)){et("`data-max-toc` must have a value between 0-6 (inclusive).",Uo,{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=Zo(Yo(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=ve`<nav id="toc"></nav>`,n=ve`<h2 class="introductory">${Vo.toc}</h2>`;Fe(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=ve`<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=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 + </p>`;document.body.append(o)}(t)}r("toc")}});const Xo=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 Jo=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(ve`<p><em>${Xo.informative}</em></p>`)}))}});const ei=ze({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${je(t.textContent)}`),n}}});var ti=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||(Fe(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=ei.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=ve`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=ve`<a href="#${t}" class="self-link" aria-label="${r}" - ></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 + ></a>`;o.append(n,i)}}});const ni="ui/save-html",ri=ze({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),oi=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return st(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return st(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 ii(e,t){const{id:n,href:r,ext:o,title:i,type:s}=e,a=function(e,t=""){return Ae.format(e).replace(Ce,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return ve`<a href="${r}" id="${n}" download="${l}.${o}" type="${s}" class="respec-save-button" - onclick=${()=>Pt.closeModal()} + onclick=${()=>jt.closeModal()} >${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=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` + >`}var si=Object.freeze({__proto__:null,exportDocument:function(e,t){return tt("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",ni,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),st(t)},name:ni,run:function(e){const t={async show(t){await document.respec.ready;const n=ve`<div class="respec-save-buttons"> + ${oi.map((t=>ii(t,e)))} + </div>`;jt.freshModal(ri.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=jt.addCommand(ri.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const ai=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 li=document.createElement("div"),ci=ve.bind(li),ui=jt.addCommand(`${ai.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(di).forEach((t=>{e.push(t)}));ci` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -403,12 +402,12 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} </thead> <tbody>${e}</tbody> </table> -`,Pt.freshModal(`${si.about_respec} - ${window.respecVersion}`,ai,ci)}),"Ctrl+Shift+Alt+A","ℹ️");function ui({name:e,duration:t}){return we` +`,jt.freshModal(`${ai.about_respec} - ${window.respecVersion}`,li,ui)}),"Ctrl+Shift+Alt+A","ℹ️");function di({name:e,duration:t}){return ve` <tr> <td><a href="${`https://github.com/w3c/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}var di=Object.freeze({__proto__:null});var pi=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 fi=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa} + `}var pi=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 hi=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} @@ -419,9 +418,9 @@ 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 hi(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-aom.js",document.baseURI).href));return await t.text()}const mi=Te({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(mi);const gi=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return xs}))).default}catch{return hi("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",gi.then((e=>({worker:e}))));const bi=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function yi(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:bi(),languages:t},r=await gi;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 wi=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(yi);document.head.appendChild(we`<style> - ${fi} - </style>`),await Promise.all(n)}});const vi="core/list-sorter";function xi(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function ki(e,t){return[...e.querySelectorAll(":scope > li")].sort(xi(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function $i(e,t){return[...e.querySelectorAll(":scope > dt")].sort(xi(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 _i=Object.freeze({__proto__:null,name:vi,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=$i(t,n);break;case"ol":case"ul":e=ki(t,n);break;default:et(`ReSpec can't sort ${t.localName} elements.`,vi,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:$i,sortListItems:ki});var Ei=String.raw`var:hover{text-decoration:underline;cursor:pointer} +.hljs-link{text-decoration:underline}`;async function mi(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-aom.js",document.baseURI).href));return await t.text()}const gi=Re({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(gi);const bi=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return ks}))).default}catch{return mi("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",bi.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 wi(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 bi;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 vi=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(wi);document.head.appendChild(ve`<style> + ${hi} + </style>`),await Promise.all(n)}});const xi="core/list-sorter";function ki(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(ki(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function _i(e,t){return[...e.querySelectorAll(":scope > dt")].sort(ki(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 Ei=Object.freeze({__proto__:null,name:xi,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=_i(t,n);break;case"ol":case"ul":e=$i(t,n);break;default:tt(`ReSpec can't sort ${t.localName} elements.`,xi,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:_i,sortListItems:$i});var Si=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} @@ -432,11 +431,11 @@ 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 Si(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=Pe(e.textContent),n=e.closest("section"),r=Ai(e),o=[...n.querySelectorAll("var")].filter((e=>Pe(e.textContent)===t&&e.closest("section")===n)),i=o[0].classList.contains("respec-hl");if(Ci.set(r,i),i)return o.forEach((e=>Li(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=Ai(t);n.forEach((t=>Li(t,e))),[...Ci.keys()].forEach((e=>Ci.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const Ci=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 Ai(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===Ci.get("respec-hl-c1")?"respec-hl-c1":[...Ci.keys()].find((e=>Ci.get(e)))||"respec-hl-c1"}function Li(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var Ti=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Ei,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",Si))),o("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(Li)}))}});var Ri=String.raw`var{position:relative;cursor:pointer} +}`;function Ci(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=je(e.textContent),n=e.closest("section"),r=Li(e),o=[...n.querySelectorAll("var")].filter((e=>je(e.textContent)===t&&e.closest("section")===n)),i=o[0].classList.contains("respec-hl");if(Ai.set(r,i),i)return o.forEach((e=>Ti(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=Li(t);n.forEach((t=>Ti(t,e))),[...Ai.keys()].forEach((e=>Ai.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const Ai=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 Li(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===Ai.get("respec-hl-c1")?"respec-hl-c1":[...Ai.keys()].find((e=>Ai.get(e)))||"respec-hl-c1"}function Ti(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var Ri=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Si,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",Ci))),o("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(Ti)}))}});var Ni=String.raw`var{position:relative;cursor:pointer} 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 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} +var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Oi=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Ni,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 Di=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var Ii=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(ve`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=Di,document.head.appendChild(t)}});const Pi="core/anchor-expander";function ji(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void et(`Found matching element "${t}", but it has no title or marker.`,Pi,{title:"Missing title.",elements:[n]})}const o=Ye(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 et(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Pi,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ye(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 et(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Pi,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ye(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 qi(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Fi(r,n),Bi(r,n);else{n.textContent=n.getAttribute("href");et("Found matching section, but the section was lacking a heading element.",Pi,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Fi(e,t){const n=e.querySelector(".self-link"),r=[...Ye(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=He(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Bi(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:Pi,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":Fi(n,t);break;case"section":qi(n,e,t);break;case"figure":zi(n,e,t);break;case"table":Mi(n,e,t);break;case"aside":case"div":ji(n,e,t);break;default:t.textContent=t.getAttribute("href");et("ReSpec doesn't support expanding this kind of reference.",Pi,{title:`Can't expand "#${e}".`,elements:[t]})}Bi(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");et(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Pi,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Wi=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} @@ -453,7 +452,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Ni=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 Wi(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")||Pe(e.textContent),s=we` +.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 Ui(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=ve` <div class="dfn-panel" id="${o}" @@ -470,11 +469,11 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Ni=Obje aria-label="Permalink for definition: ${i}. Activate to close this dialog." >Permalink</a > - ${function(e){return e.matches("dfn[data-export]")?we`<span + ${function(e){return e.matches("dfn[data-export]")?ve`<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 we`<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 ve`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -482,19 +481,19 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Ni=Obje >`}}return null}(e,r)} </div> <p><b>Referenced in:</b></p> - ${function(e,t){if(!t.length)return we`<ul> + ${function(e,t){if(!t.length)return ve`<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?`§ ${Pe(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> + </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=>ve`<li> + ${r(e).map((e=>ve`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} + </li>`;return ve`<ul> ${[...n].map(o)} </ul>`}(t,r)} </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)=>{}));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)` + `;return s}var Vi=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(ve`<style> + ${Wi} + </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(Ui(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 mi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Zi=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 Gi="rs-changelog",Yi=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;ve.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..."}} + ${{any:Ki(e,t,n).then((e=>async function(e){const{repoURL:t}=await Zi;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,i=r&&ve` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return ve`<li><a href="${o}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>et(e.message,Gi,{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=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})()'})}(); + `}};async function Ki(e,t,n){let r;try{const o=await Zi;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:Yi,name:Gi})];var Xi=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 Ji="core/linter-rules/check-charset",es=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 ts=Object.freeze({__proto__:null,name:Ji,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||tt(es.msg,Ji,{hint:es.hint,elements:[...t]})}});const ns="core/linter-rules/check-punctuation",rs=[".",":","!","?"],os=ze({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${rs.map((e=>`"${e}"`)).join(", ")}.`}});var is=Object.freeze({__proto__:null,name:ns,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${rs.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&tt(os.msg,ns,{hint:os.hint,elements:n})}});const ss="core/linter-rules/local-refs-exist",as=ze({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function ls(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var cs=Object.freeze({__proto__:null,name:ss,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(ls);t.length&&tt(as.msg,ss,{hint:as.hint,elements:t})}});const us="core/linter-rules/no-headingless-sections",ds=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 ps=Object.freeze({__proto__:null,name:us,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&&tt(ds.msg,us,{hint:ds.hint,elements:t})}});const fs="core/linter-rules/no-unused-vars",hs=ze({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var ms=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&&tt(hs.msg,fs,{hint:hs.hint,elements:t})}});const gs="core/linter-rules/privsec-section",bs=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 ys=Object.freeze({__proto__:null,name:gs,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})))&&tt(bs.msg,gs,{hint:bs.hint})}});const ws="core/linter-rules/no-http-props",vs=ze({en:{msg:ot`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:ot`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var xs=Object.freeze({__proto__:null,name:ws,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=>ot`${`[${e}]`}`));tt(vs.msg,ws,{hint:vs.hint+e})}}}),ks=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-aom.js.map diff --git a/builds/respec-aom.js.map b/builds/respec-aom.js.map index fb6a4c679e..c78abca625 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.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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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,G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uB,UAdzC6f,MAAM2L,KAAK2C,EAAIrP,iBAAiB,uBAAuBpb,MAC5D,EAAG6gB,YAAa9X,MACd,MAAMskD,EAAgB,uBAAuBtqD,KAAKgG,GAC5CukD,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 +{"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 getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\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 pluralize$1 = {exports: {}};\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 pluralizeExports = pluralize$1.exports;\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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","getDefaultExportFromCjs","x","__esModule","module","pluralize$1","exports","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","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","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","saysPrivO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EAAqB,qBAAqBzqD,KAAKgG,GACrD,OAAQwkD,GAAiBC,GAAuBD,CAAa,MAW/DvhC,GAAYrvB,GAAKyZ,IAAKzb,GAAM,CAAEyvB,KAAMztB,GAAKytB,MAE7C,ICnCA,MACazvB,GAAO,kCAYdgC,GAAO4uB,GAVe,CAC1B1uB,GAAI,CACFuZ,IAAKqa,EAAO,oCAAoC,oBAChDrG,KAAM,0DAER4W,GAAI,CACF5qB,IAAKqa,EAAO,GAAG,kCACfrG,KAAM,0EAKH,SAAauL,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKzhC,OAAOQ,SAASwK,KAAKyjB,WAAW,QACnC,OAGF,MAAM4jC,EAAmB37C,OAAO47C,oBAAoB/3B,GAEjD3oB,QAAO4b,GAAQA,EAAI+H,SAAS,QAAUgF,EAAK/M,IAAiB,WAARA,IAEpD5b,QAAO4b,GACN,IAAIoB,IAAI2L,EAAK/M,GAAMxtB,OAAOQ,SAASwK,MAAMA,KAAKyjB,WAAW,aAG7D,GAAI4jC,EAAiB3lD,OAAQ,CAC3B,MAAMsL,EAAOiY,GAAQoiC,GAAkB7kC,GAAO6H,EAAO,GAAG,IAAI7H,SAC5DoD,GAAYrvB,GAAKyZ,IAAKzb,GAAM,CAAEyvB,KAAMztB,GAAKytB,KAAOhX,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 b17aa691b0..d0019642b0 100644 --- a/builds/respec-dini.js +++ b/builds/respec-dini.js @@ -1,7 +1,6 @@ -window.respecVersion="33.0.2",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` +window.respecVersion="33.0.3",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=/[&<>"']/,P=new RegExp(z.source,"g"),D=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,j=new RegExp(D.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},I=e=>O[e];function M(e,t){if(t){if(z.test(e))return e.replace(P,I)}else if(D.test(e))return e.replace(j,I);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]||(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?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,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]):M(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:M(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]):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)){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=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]*?(?:</\\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+M(r)+'">'+(n?e:M(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:M(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>"+M(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;function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge,be={exports:{}};ge=be,function(e,t){ge.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 ye=me(be.exports),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;)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,P={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)}}},D=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 M,q,F,B,H,W,U,V,Z,K=(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<i;s++)r[q](e(o[s],n));return r}:W?M[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 qe: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(P.invoke(e,t)).then(t)}function ze(e){return null!=e&&"then"in e}var Pe,De,je,Oe,Ie,Me="ownerSVGElement",qe=v.prototype.nodeType,Fe=Ae.prototype.nodeType,Be=(De=(Pe={Event:b,WeakSet:u}).Event,je=Pe.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 De(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=Me 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 P.attributes)return function(n){var o=P.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=Me 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,D(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(D(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):P.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(""):P.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(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,ot,it,st=P.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);const ve=we,xe=S,ke=fe,$e=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=ye;function Ee(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:Ee,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Ee(e.innerHTML)}});const Ce=/-/g,Ae=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Le="en"===l||l.startsWith("en-")?"en-AU":l,Te=new Intl.DateTimeFormat(Le,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Le?"2-digit":"numeric"});function Re(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 Ne(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function ze(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 Pe=ze("conjunction"),De=ze("disjunction");function je(e,t){return Pe(e,t).join("")}function Oe(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 Me(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){tt(`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=>ve`${e}, `));return ve`${r}${n[n.length-1]}`}function Fe(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 Be(e){const t=new Set,n="ltNodefault"in e.dataset?"":Oe(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>Oe(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(Oe(e))))}return[...t]}function He(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 Ue(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Ve(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 Ze(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 Ke 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 Ye(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{He(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Xe(t),t}function Xe(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ge(t)])e.remove()}function*Ge(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 Je 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||Fe(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 et(e,t,n={}){const o={...n,isWarning:!1};r("error",new Je(e,t,o))}function tt(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Je(e,t,o))}function nt(e){return e?`\`${e}\``:""}function rt(e,{quotes:t}={quotes:!1}){return De(e,t?e=>{return nt((t=e,String(t)?`"${t}"`:""));var t}:nt).join("")}function ot(e,...t){return Ee(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 it=new Map([["text/html","html"],["application/xml","xml"]]);function st(e,t=document){const n=it.get(e);if(!n){const t=[...it.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=at(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function at(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Xe(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Ne(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=ve`<meta charset="utf-8" />`);i.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=ve` <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} + `;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:st});class lt{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 at("html",document)}}const ct="core/post-process";const ut="core/pre-process";const dt="core/base-runner";async function pt(e){!function(){const e=new lt;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(`${dt}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||et("Every item in `preProcess` must be a JS function.",ut),t})).map((async t=>{try{return await t(e,document)}catch(e){et(`Function ${t.name} threw an error during \`preProcess\`.`,ut,{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||et("Every item in `postProcess` must be a JS function.",ct),t})).map((async t=>{try{return await t(e,document)}catch(e){et(`Function ${t.name} threw an error during \`postProcess\`.`,ct,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Ne(document),performance.mark(`${dt}-end`),performance.measure(dt,`${dt}-start`,`${dt}-end`)}var ht=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 +64,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 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` +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const ft=/>/gm,mt=/&/gm;class gt extends ke.Renderer{code(e,t,n){const{language:r,...o}=gt.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(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 + `}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 bt={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new gt};function yt(e,t={inline:!1}){const n=Ee(e).replace(ft,">").replace(mt,"&");return t.inline?ke.parseInline(n,bt):ke.parse(n,bt)}function wt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=yt(e.innerHTML)}const vt=(xt="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(xt);return t.forEach(wt),Array.from(t)});var xt;var kt=Object.freeze({__proto__:null,markdownToHtml:yt,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 vt(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=Ze(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 $t(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=ht,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const _t=ve`<div id="respec-ui" class="removeOnSave" hidden></div>`,Et=ve`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" hidden -></ul>`,Et=we`<button +></ul>`,St=ve`<button class="close-button" - onclick=${()=>jt.closeModal()} + onclick=${()=>Ot.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=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 +</button>`;let Ct,At;window.addEventListener("load",(()=>Pt(Et)));const Lt=[],Tt=[],Rt={};o("start-all",(()=>document.body.prepend(_t)),{once:!0}),o("end-all",(()=>document.body.prepend(_t)),{once:!0});const Nt=ve`<button id="respec-pill" disabled>ReSpec</button>`;function zt(){Et.classList.toggle("respec-hidden"),Et.classList.toggle("respec-visible"),Et.hidden=!Et.hidden}function Pt(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(Nt),Nt.addEventListener("click",(e=>{e.stopPropagation(),Nt.setAttribute("aria-expanded",String(Et.hidden)),zt(),Et.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{Et.hidden||zt()})),_t.appendChild(Et),Et.addEventListener("keydown",(e=>{"Escape"!==e.key||Et.hidden||(Nt.setAttribute("aria-expanded",String(Et.hidden)),zt(),Nt.focus())}));const Dt=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function jt(e,t,n,r){t.push(e),Rt.hasOwnProperty(n)||(Rt[n]=function(e,t,n){const r=ve`<button id="${`respec-pill-${e}`}" class="respec-info-button" - ></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"> + ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=ve`<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)}Ot.freshModal(n,o,r)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return $t(r,o),r}(n,t,r),_t.appendChild(Rt[n]));const o=Rt[n];o.textContent=t.length;const i=1===t.length?_e.singular(r):r;$t(o,new Map([["label",`${t.length} ${i}`]]))}$t(Nt,Dt);const Ot={show(){try{_t.hidden=!1}catch(e){console.error(e)}},hide(){_t.hidden=!0},enable(){Nt.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=ve`<button id="${o}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}… - </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 + </button>`,s=ve`<li role="menuitem">${i}</li>`;return s.addEventListener("click",t),Et.appendChild(s),i},error(e){jt(e,Lt,"error","ReSpec Errors")},warning(e){jt(e,Tt,"warning","ReSpec Warnings")},closeModal(e){At&&(At.classList.remove("respec-show-overlay"),At.classList.add("respec-hide-overlay"),At.addEventListener("transitionend",(()=>{At.remove(),At=null}))),e&&e.setAttribute("aria-expanded","false"),Ct&&(Ct.remove(),Ct=null,Nt.focus())},freshModal(e,t,n){Ct&&Ct.remove(),At&&At.remove(),At=ve`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;Ct=ve`<div id="${r}" class="respec-modal removeOnSave" role="dialog" aria-labelledby="${o}" > - ${Et} + ${St} <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 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{ + </div>`;const i=new Map([["labelledby",o]]);$t(Ct,i),document.body.append(At,Ct),At.addEventListener("click",(()=>this.closeModal(n))),At.classList.toggle("respec-show-overlay"),Ct.hidden=!1,Pt(Ct)}};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${yt(`<p class="respec-hint"><strong>How to fix:</strong> ${Ee(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 ${yt(e.elements.map(Mt).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${yt(`**${e.message}**`,{inline:!0})}${n}${r}${o}${t}`}function Mt(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function qt(e){try{Ot.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await pt(e)}finally{Ot.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&Ot.closeModal()})),window.respecUI=Ot,o("error",(e=>Ot.error(e))),o("warn",(e=>Ot.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const Ft=[Promise.resolve().then((function(){return Bt})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Vt})),Promise.resolve().then((function(){return Yt})),Promise.resolve().then((function(){return Qt})),Promise.resolve().then((function(){return an})),Promise.resolve().then((function(){return kt})),Promise.resolve().then((function(){return Se})),Promise.resolve().then((function(){return un})),Promise.resolve().then((function(){return Sn})),Promise.resolve().then((function(){return Ln})),Promise.resolve().then((function(){return Tn})),Promise.resolve().then((function(){return zn})),Promise.resolve().then((function(){return Br})),Promise.resolve().then((function(){return Vr})),Promise.resolve().then((function(){return ro})),Promise.resolve().then((function(){return oo})),Promise.resolve().then((function(){return lo})),Promise.resolve().then((function(){return fo})),Promise.resolve().then((function(){return wo})),Promise.resolve().then((function(){return ko})),Promise.resolve().then((function(){return cr})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return No})),Promise.resolve().then((function(){return vr})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return nn})),Promise.resolve().then((function(){return Uo})),Promise.resolve().then((function(){return Jo})),Promise.resolve().then((function(){return ti})),Promise.resolve().then((function(){return ri})),Promise.resolve().then((function(){return li})),Promise.resolve().then((function(){return fi})),Promise.resolve().then((function(){return mi})),Promise.resolve().then((function(){return ki})),Promise.resolve().then((function(){return Ci})),Promise.resolve().then((function(){return zi})),Promise.resolve().then((function(){return Di})),Promise.resolve().then((function(){return Oi})),Promise.resolve().then((function(){return Ui})),Promise.resolve().then((function(){return Ki})),Promise.resolve().then((function(){return es})),Promise.resolve().then((function(){return rs})),Promise.resolve().then((function(){return as})),Promise.resolve().then((function(){return ds})),Promise.resolve().then((function(){return fs})),Promise.resolve().then((function(){return bs})),Promise.resolve().then((function(){return vs})),Promise.resolve().then((function(){return $s}))];Promise.all(Ft).then((e=>qt(e))).catch((e=>console.error(e)));var Bt=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 Ht={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"}]]),Ut={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 Vt=Object.freeze({__proto__:null,name:"dini/defaults",run:function(e){const t=!1!==e.lint&&{...Ht.lint,...Ut.lint,...e.lint};Object.assign(e,{...Ht,...Ut,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:Wt.get(e.license)}}(e))}});var Zt=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 +149,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")||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` +}`;const Kt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Zt,document.head.appendChild(e),e}();var Yt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Kt.remove()}});const Xt="dini/style";const Gt=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(Re))t.appendChild(n);return t}();Gt.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]")||Gt.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(Gt);var Qt=Object.freeze({__proto__:null,name:Xt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",tt(t,Xt)}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 Jt{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(en(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function en(e){const t=new Jt(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 tn(e){const t=en(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 nn=Object.freeze({__proto__:null,name:"core/sections",restructure:tn,run:function(){tn(document.body)}});const rn="core/data-include";function on(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=Me(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=yt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&tn(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 sn(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);on(await o.text(),r,n),t<3&&await sn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),et(r,rn,{elements:[e]})}}));await Promise.all(r)}var an=Object.freeze({__proto__:null,name:rn,run:async function(){await sn(document,1)}});const ln="core/title",cn=Ie({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var un=Object.freeze({__proto__:null,name:ln,run:function(e){const t=document.querySelector("h1#title")||ve`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){et('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">`.',ln,{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||`${cn.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=Oe(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=ve` 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` + `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function dn(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return tt(t,"core/templates/show-link"),void console.warn(t,e)}return ve` <dt class="${e.class?e.class:null}">${e.key}</dt> - ${e.data?e.data.map(dn):dn(e)} - `}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" + ${e.data?e.data.map(pn):pn(e)} + `}function pn(e){return ve`<dd class="${e.class?e.class:null}"> + ${e.href?ve`<a href="${e.href}">${e.value||e.href}</a>`:e.value} + </dd>`}const hn="core/templates/show-logo";function fn(e,t){const n=ve`<a href="${e.url||null}" class="logo" ><img alt="${e.alt||null}" crossorigin @@ -166,7 +165,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 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 + </a>`;if(!e.alt){const r=ot`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;et(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,hn,{hint:r,elements:[n]})}if(!e.src){const e=ot`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;et(`Logo at index ${t} is missing "\`src\`" property.`,hn,{hint:e,elements:[n]})}return n}const mn="core/templates/show-people",gn=Ie({en:{until:e=>ve` Until ${e} `},es:{until:e=>ve` Hasta ${e} `},ko:{until:e=>ve` ${e} 이전 `},ja:{until:e=>ve` ${e} 以前 `},de:{until:e=>ve` bis ${e} `},zh:{until:e=>ve` 直到 ${e} `}});function bn(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 et(`${i} Missing required property \`"name"\`.`,mn,{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 et(n,mn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return et(`${i} ORCID "${o}" has wrong format.`,mn,{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 et(`${i} ORCID "${n}" failed checksum check.`,mn,{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())?(et(`${i} The property "\`retiredDate\`" is not a valid date.`,mn,{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 et(`${n}. Member "extra" at index ${r} is not an object.`,mn,{hint:t}),!1;case!e.hasOwnProperty("name"):return et(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,mn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return et(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,mn,{hint:t}),!1}return!0})):(et(`${n}. A person's "extras" member must be an array.`,mn,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&tt(`${i} Has both "url" and "mailto" property.`,mn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&tt(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,mn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var s});var o;return n.filter(r).map(yn)}function yn(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(ve`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(ve`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(ve`<a class="p-name orcid" href="${e.orcid}">${ve`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" @@ -185,15 +184,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?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(we` - ${mn.until(e)} `)}return we`<dd +</svg>`}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?ve`<a class="${t}" href="${e.companyURL}">${n}</a>`:ve`<span class="${t}">${n}</span>`;o.push(ve` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>ve`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?ve`<a href="${r}" class="${t}">${n}</a>`:ve`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:i}=e;if(e.retiredDate){const e=ve`<time datetime="${i}" + >${Te.format(new Date(i))}</time + >`;o.push(ve` - ${gn.until(e)} `)}return ve`<dd class="editor p-author h-card vcard" data-editor-id="${r}" > ${o} - </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")} + </dd>`}const wn="dini/templates/headers",vn="https://creativecommons.org/licenses/by/4.0/legalcode",xn=Ie({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 kn=e=>ve`<div class="head"> + ${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> ${e.textStatus} @@ -202,81 +201,81 @@ dd{margin-left:0} > </h2> <dl> - <dt>${e.multipleEditors?vn.editors:vn.editor}</dt> - ${gn(e,"editors")} - ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?we` + <dt>${e.multipleEditors?xn.editors:xn.editor}</dt> + ${bn(e,"editors")} + ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?ve` <dt> - ${e.multipleFormerEditors?vn.former_editors:vn.former_editor} + ${e.multipleFormerEditors?xn.former_editors:xn.former_editor} </dt> - ${gn(e,"formerEditors")} + ${bn(e,"formerEditors")} `:""} - ${e.authors?we` - <dt>${e.multipleAuthors?vn.authors:vn.author}</dt> - ${gn(e,"authors")} + ${e.authors?ve` + <dt>${e.multipleAuthors?xn.authors:xn.author}</dt> + ${bn(e,"authors")} `:""} - ${e.otherLinks?e.otherLinks.map(un):""} + ${e.otherLinks?e.otherLinks.map(dn):""} </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.",yn,{hint:'Please use `<p class="copyright">` instead.'})}return e.overrideCopyright?[e.overrideCopyright]:we`<p class="copyright"> + ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.hasOwnProperty("overrideCopyright")){tt("The `overrideCopyright` configuration option is deprecated.",wn,{hint:'Please use `<p class="copyright">` instead.'})}return e.overrideCopyright?[e.overrideCopyright]:ve`<p class="copyright"> Dieses Dokument ist lizensiert unter - ${n="Creative Commons Attribution 4.0 International Public License",r=wn,o="subfoot",we`<a rel="license" href="${r}" class="${o}">${n}</a>`}. + ${n="Creative Commons Attribution 4.0 International Public License",r=vn,o="subfoot",ve`<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 Hn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return we`<a + </div>`;const $n="dini/headers",_n=new Intl.DateTimeFormat(["de-DE"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"}),En={unofficial:"Entwurf vom",base:"Spezifikation vom"};var Sn=Object.freeze({__proto__:null,name:$n,run:function(e){if(e.isUnofficial="unofficial"===e.specStatus,e.isBasic="base"===e.specStatus,!e.specStatus){et("Missing required configuration: `specStatus`",$n)}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=Ae.format(r);return new Date(e)}return et(`[\`${t}\`](https://github.com/w3c/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,$n),new Date(Ae.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){et("All authors and editors must have a name.",$n)}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){et(`"${e.orcid}" is not an ORCID. ${t.message}`,$n),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){et("At least one editor is required",$n)}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){et("All alternate formats must have a uri and a label.",$n)}})),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=En[e.specStatus],e.dashDate=Ae.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=kn(e);document.body.prepend(n),document.body.classList.add("h-entry"),r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const Cn="dini/abstract",An=Ie({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var Ln=Object.freeze({__proto__:null,name:Cn,run:async function(){const e=document.getElementById("abstract");if(!e){return void et('Document must have one element with `id="abstract"',Cn)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=An.abstract,e.prepend(t))}});var Tn=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Me(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Rn="core/dfn-abbr";function Nn(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 zn=Object.freeze({__proto__:null,name:Rn,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Nn(t);else{et(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Rn,{elements:[t],title:"Error: unsupported."})}}}});const Pn=/^[a-z]+(\s+[a-z]+)+\??$/,Dn=/\B"([^"]*)"\B/,jn=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,On=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,In=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Mn=/^(?:\w+)\??$/,qn=/^(\w+)\["([\w- ]*)"\]$/,Fn=/\.?(\w+\(.*\)$)/,Bn=/\/(.+)/,Hn=/\[\[.+\]\]/;function Wn(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return ve`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></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 + >`}function Un(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:s}=n||{},a="method"===r,l=a?ve`(${qe(i,Vn)})`:null,c=a?`(${i.join(", ")})`:"";return ve`${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 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 + >`}function Vn(e,t,n){if(t<n.length-1)return ve`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return ve`${o?"...":null}<var>${i}</var>`}function Zn(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return ve`${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 we`${o&&i?".":""}<a + >`}function Kn(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,Vn),u=`${n}(${t.join(", ")})`;return ve`${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?we`<code>(${c})</code>`:""}`}function Kn(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return we`"<a + >${!s||a?ve`<code>(${c})</code>`:""}`}function Yn(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return ve`"<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 we`"<a + >"`}function Xn(e){const{identifier:t}=e;return ve`"<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 we`<a + >"`}function Gn(e){const{identifier:t,nullable:n}=e;return ve`<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=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> + >`}function Qn(e){let t;try{t=function(e){const t=Hn.test(e),n=t?Bn:Fn,[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(jn.test(t)){const[,e,n,r,o]=t.match(jn),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(On.test(t)){const[,e,n]=t.match(On),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(Pn.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(!Mn.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=ve`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return et(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=ve(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(Zn(e));break;case"internal-slot":r.push(Un(e));break;case"method":r.push(Kn(e));break;case"enum":r.push(Yn(e));break;case"exception":r.push(Xn(e));break;case"idl-primitive":r.push(Gn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Jn=new Set(["alias","reference"]),er=async function(){const e=await xe.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[...Jn]){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 tr={get ready(){return er},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Jn.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(!Jn.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=[...Jn].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Jn.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=[...Jn],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},nr={},rr=new URL("https://api.specref.org/bibrefs?refs="),or=Re({hint:"dns-prefetch",href:rr.origin});let ir;document.head.appendChild(or);const sr=new Promise((e=>{ir=e}));async function ar(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(rr.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 tr.addAll(o,e)}catch(e){console.error(e)}return o}async function lr(e){const t=await sr;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await lr(n.aliasOf):n}var cr=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=nr;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 tr.ready;const n=e.map((async e=>({id:e,data:await tr.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=>{nr[e.id]=e.data}));const i=o.noData.map((e=>e.id));if(i.length){const e=await ar(i,{forceUpdate:!0});Object.assign(nr,e)}Object.assign(nr,this.conf.localBiblio),(()=>{ir(this.conf.biblio)})()}},biblio:nr,name:"core/biblio",resolveRef:lr,updateFromNetwork:ar});const ur="core/render-biblio",dr=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:"参考文献"}}),pr=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"]]),hr=(fr=".",e=>{const t=e.trim();return!t||t.endsWith(fr)?t:t+fr});var fr;function mr(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(gr)),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=ve`<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=we`<cite + <dl class="bibliography">${i.map(yr)}</dl> + </section>`;Fe(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()));et(`Reference "[${t}]" not found.`,ur,{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 gr(e){let t=nr[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;et(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,ur)}else n=t.aliasOf,t=nr[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function br(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=ve`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?o:we`[${o}]`}function br(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return we` + >`;return t?o:ve`[${o}]`}function yr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return ve` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:yr(n)}:we`<em class="respec-offending-element" - >${ur.reference_not_found}</em + ${n?{html:wr(n)}:ve`<em class="respec-offending-element" + >${dr.reference_not_found}</em >`} </dd> - `}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 + `}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} ${hr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${pr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var vr=Object.freeze({__proto__:null,name:ur,renderInlineCitation:br,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")||ve`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(ve`<h1>${dr.references}</h1>`),r.classList.add("appendix"),n.length){const e=mr(n,dr.norm_references);r.appendChild(e)}if(t.length){const e=mr(t,dr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const xr="core/inlines",kr={},$r=e=>new RegExp(e.map((e=>e.source)).join("|")),_r=Ie({en:{rfc2119Keywords:()=>$r([/\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:()=>$r([/\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/])}}),Er=/(?:`[^`]+`)(?!`)/,Sr=/(?:{{[^}]+\?*}})/,Cr=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Ar=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Lr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Tr=/(?:\[=[^=]+=\])/,Rr=/(?:\[\^[^^]+\^\])/;function Nr(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 ve`<code ><a data-xref-type="${i}" data-xref-for="${s}" @@ -284,47 +283,47 @@ dd{margin-left:0} data-link-for="${s}" >${a}</a ></code - >`}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 + >`}function zr(e){const t=Oe(e),n=ve`<em class="rfc2119">${t}</em>`;return kr[t]=!0,n}function Pr(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?ve`<a href="${t}" data-matched-text="${e}"></a>`:ve`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Dr(e,t){const n=Oe(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Qn(n);return!!t.parentElement.closest("dfn")?qr(`\`${r.textContent}\``):r}function jr(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(Oe),{type:s,illegal:a}=We(o,t.parentElement),l=br(o,i),c=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;tt("Normative references in informative sections are not allowed. ",xr,{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 Or(e,t,n){return"ABBR"===t.parentElement.tagName?e:ve`<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 ve`<var data-type="${r}">${n}</var>`}function Mr(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(Oe).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=Fr(i),a=n?Oe(n):null;return ve`<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 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> + >`}function qr(e){const t=e.slice(1,-1);return ve`<code>${t}</code>`}function Fr(e){return Er.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?qr(e):Fr(e))):document.createTextNode(e)}var Br=Object.freeze({__proto__:null,name:xr,rfc2119Usage:kr,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ke,e.informativeReferences=new Ke,e.respecRFC2119||(e.respecRFC2119=kr);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=Oe(e),o=Oe(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(`(${$r([i,Sr,Cr,Ar,Lr,Tr,Er,Rr,...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(Pr(s));break;case s.startsWith("[["):o.append(...jr(s,n,e));break;case s.startsWith("|"):o.append(Ir(s));break;case s.startsWith("[="):o.append(Mr(s));break;case s.startsWith("`"):o.append(qr(s));break;case s.startsWith("[^"):o.append(Nr(s));break;case t.has(s):o.append(Or(s,n,t));break;case i.test(s):o.append(zr(s))}else o.append(s);n.replaceWith(o)}}});const Hr="dini/conformance",Wr=Ie({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)=>ve`<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")} + ${br("RFC2119")} ${br("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)=>we`<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)=>ve`<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> - ${gr("RFC2119")} ${gr("RFC8174")} + ${br("RFC2119")} ${br("RFC8174")} und unter Berücksichtigung von <a href="https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst" >2119de</a > zu interpretieren, wenn und nur wenn ${t?"sie":"es"} wie hier gezeigt durchgehend groß geschrieben wurde${t?"n":""}. - </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} + </p>`}});function Ur(e,t){const n=[...Object.keys(kr)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(Pe(o,(e=>ve`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?ve`${e}`:e)));var o;const i=n.length>1,s=ve` + <h1>${Wr.conformance}</h1> + <p>${Wr.normativity}</p> + ${n.length?Wr.keywordInterpretation(r,i):null} + `;e.prepend(...s.childNodes)}var Vr=Object.freeze({__proto__:null,name:Hr,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Ur(t,e),!t&&Object.keys(kr).length){tt("Document uses RFC2119 keywords but lacks a conformance section.",Hr,{hint:'Please add a `<section id="conformance">`.'})}}});function Zr(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){et(`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 Kr(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return et(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Yr=new Qe;function Xr(e,t){for(const n of t)Yr.has(n)||Yr.set(n,new Set),Yr.get(n).add(e)}const Gr="core/dfn",Qr=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Kr}],["element",{requiresFor:!1,validator:Zr}],["element-attr",{requiresFor:!1,validator:Zr}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Kr}],["event",{requiresFor:!1,validator:Kr}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new $e(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return et(`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:Kr}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Kr(e.slice(1,-1),t,n,r):(et(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Jr=[...Qr.keys()];function eo(e,t){let n="";switch(!0){case Jr.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Qr.has(e))),function(e,t,n){const r=Qr.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=ot`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=ot`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;et(e,Gr,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,Gr)}(t,n,e);break;case On.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=ot`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;et(`Internal slot "${e}" must be associated with a WebIDL interface.`,Gr,{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=ot`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${rt(o,{quotes:!0})}. The slot "${e}" seems to be a "${nt(r)}"?`;return et(n,Gr,{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 to(e){switch(!0){case e.matches(".export.no-export"):et(ot`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Gr,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){et(ot`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Gr,{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 no(){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 ro=Object.freeze({__proto__:null,name:Gr,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Be(e);if(Xr(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;eo(e,n),to(e),1===t.length&&n===Oe(e.textContent)||(e.dataset.lt=t.join("|"))}o("plugins-done",no)}});var oo=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=Oe(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=Oe(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=Oe(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("|"),Xr(e,n)}}))}});var io=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?we`<span class="example-title">: ${n.title}</span>`:"";return we`<div class="marker"> - <a class="self-link">${io.example}<bdi>${r}</bdi></a +.example pre{background-color:rgba(0,0,0,.03)}`;const so=Ie({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function ao(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?ve`<span class="example-title">: ${n.title}</span>`:"";return ve`<div class="marker"> + <a class="self-link">${so.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(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=we`<div class="example" id="${i}"> + </div>`}var lo=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(ve`<style> + ${io} + </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=ao(e,t,r);e.prepend(n);const i=Fe(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=ao(e,n?0:t,r),a=ve`<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} + </div>`;Fe(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var co=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} @@ -334,39 +333,39 @@ 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=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 +.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 uo="core/issues-notes",po=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 ho(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?po.feature_at_risk:po.issue:n?po.warning:r?po.editors_note:po.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=ve`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=ve`<div role="heading" class="${`${i}-title marker`}">${c}</div>`;Fe(p,"h",i);let h,f=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):Fe(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 ve`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return ve`<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){tt(`Failed to fetch issue number ${u}.`,uo)}h&&!d.title&&(d.title=h.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?ve`<span style="text-transform: none">: ${t.title}</span>`:"";return ve`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(po.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 ve` <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 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 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=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=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||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")})),we`<li class="tofline"> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return ve`<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=Ve(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(ve`<p>${po.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${po.issue_summary}</h1>`)}(o)}var fo=Object.freeze({__proto__:null,name:uo,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 et(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,uo),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(ve`<style> + ${co} + </style>`,o.querySelector("link")),ho(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const mo="core/best-practices",go={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},bo=Ie(go),yo=l in go?l:"en";var wo=Object.freeze({__proto__:null,name:mo,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=Fe(e,"bp"),o=ve`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${yo}">${bo.best_practice}${t+1}</bdi></a + >`;if(n){const t=ve`<li>${o}: ${Ye(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=ve`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(ve`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){tt("Using best practices summary (#bp-summary) but no best practices found.",mo),t.remove()}}});const vo="core/figures",xo=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 ko=Object.freeze({__proto__:null,name:vo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||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;Fe(e,"fig",r),Ue(t,ve`<span class="fig-title"></span>`),t.prepend(ve`<a class="self-link" href="#${e.id}" + >${xo.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=>{He(e,"span").removeAttribute("href")})),ve`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> - </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"> + </li>`}(t.id,r));else{tt("Found a `<figure>` without a `<figcaption>`.",vo,{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(ve`<h1>${xo.list_of_figures}</h1>`,ve`<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?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"> + </ul>`))}});const $o="core/data-cite",_o="__SPEC__";async function Eo(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 lr(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 So(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?Ue(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){et("Exporting an linked external definition is not allowed.",$o,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function Co(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Ao=Co("#"),Lo=Co("/");function To(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?To(r):{key:_o,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=n.replace("#",""),To(e)}const s=r?`#${r}`:Ao(n),a=o||Lo(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 Ro(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 No=Object.freeze({__proto__:null,THIS_SPEC:_o,name:$o,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(To).map((async e=>({entry:e,result:await lr(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await ar(n);r&&Object.assign(nr,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=To(t),r=await Eo(n);if(r)So(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),tt(n,$o,{elements:[t]})}}o("beforesave",Ro)},toCiteDetails:To});const zo="core/link-to-dfn",Po=[],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:"在文档中有重复的定义。"}},jo=Ie(Do);function Oo(e){const t=new Map,n=[];for(const r of Yr.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),Fe(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=Be(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 Mo(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||Ue(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 Fo(e){e.forEach((e=>{tt(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,zo,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var Bo=Object.freeze({__proto__:null,name:zo,possibleExternalLinks:Po,run:async function(e){const t=function(){const e=new Qe;for(const t of Yr.keys()){const{result:n,duplicates:r}=Oo(t);e.set(t,n),r.length>0&&et(jo.duplicateMsg(t),zo,{title:jo.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){Po.push(e);continue}const r=Io(e,t);if(r){Mo(e,r,t)||Po.push(e)}else""===e.dataset.cite?n.push(e):Po.push(e)}Fo(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}=To(t);r!==_o&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Fo(Po)}});const Ho="core/contrib";var Wo=Object.freeze({__proto__:null,name:Ho,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void et(ot`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Ho)}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 ve(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 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 et("Error loading contributors from GitHub.",Ho),console.error(e),null}}}(t,n)}});var Uo=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);He(e,`h${t}`)}))}});const Vo=["h2","h3","h4","h5","h6"],Zo="core/structure",Ko=Ie({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Yo(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=ve`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=i,r=!0);let e=a.isIntro?"":r?Xo(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(ve`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Qo(a.header,n),o=Yo(a.subsections,t,{prefix:e});o&&r.append(o),s.append(r)}}return s}function Xo(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(!Vo.includes(r.localName))continue;const o=r.textContent;Fe(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 Qo(e,t){const n=ve`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=He(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{He(e,"span").removeAttribute("id")})),ve`<li class="tocline">${n}</li>`}var Jo=Object.freeze({__proto__:null,name:Zo,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(Ve(e,"section").length+1,6)}`;e.localName!==t&&He(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)){et("`data-max-toc` must have a value between 0-6 (inclusive).",Zo,{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=Yo(Go(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=ve`<nav id="toc"></nav>`,n=ve`<h2 class="introductory">${Ko.toc}</h2>`;Fe(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=ve`<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(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 + </p>`;document.body.append(o)}(t)}r("toc")}});const ei=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 ti=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(ve`<p><em>${ei.informative}</em></p>`)}))}});const ni=Ie({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Oe(t.textContent)}`),n}}});var ri=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||(Fe(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=ni.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=ve`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=ve`<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 we`<a + ></a>`;o.append(n,i)}}});const oi="ui/save-html",ii=Ie({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),si=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return st(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return st(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 ai(e,t){const{id:n,href:r,ext:o,title:i,type:s}=e,a=function(e,t=""){return Ae.format(e).replace(Ce,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return ve`<a href="${r}" id="${n}" download="${l}.${o}" type="${s}" class="respec-save-button" - onclick=${()=>jt.closeModal()} + onclick=${()=>Ot.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=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=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` + >`}var li=Object.freeze({__proto__:null,exportDocument:function(e,t){return tt("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",oi,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),st(t)},name:oi,run:function(e){const t={async show(t){await document.respec.ready;const n=ve`<div class="respec-save-buttons"> + ${si.map((t=>ai(t,e)))} + </div>`;Ot.freshModal(ii.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=Ot.addCommand(ii.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const ci=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 ui=document.createElement("div"),di=ve.bind(ui),pi=Ot.addCommand(`${ci.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(hi).forEach((t=>{e.push(t)}));di` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -390,12 +389,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 we` +`,Ot.freshModal(`${ci.about_respec} - ${window.respecVersion}`,ui,pi)}),"Ctrl+Shift+Alt+A","ℹ️");function hi({name:e,duration:t}){return ve` <tr> <td><a href="${`https://github.com/w3c/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}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} + `}var fi=Object.freeze({__proto__:null});var mi=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 gi=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,9 +405,9 @@ 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 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} +.hljs-link{text-decoration:underline}`;async function bi(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 yi=Re({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(yi);const wi=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return _s}))).default}catch{return bi("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 vi=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function xi(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:vi(),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 ki=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(xi);document.head.appendChild(ve`<style> + ${gi} + </style>`),await Promise.all(n)}});const $i="core/list-sorter";function _i(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function Ei(e,t){return[...e.querySelectorAll(":scope > li")].sort(_i(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function Si(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 Ci=Object.freeze({__proto__:null,name:$i,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=Si(t,n);break;case"ol":case"ul":e=Ei(t,n);break;default:tt(`ReSpec can't sort ${t.localName} elements.`,$i,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:Si,sortListItems:Ei});var Ai=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} @@ -419,11 +418,11 @@ 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 Ai(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=je(e.textContent),n=e.closest("section"),r=Ti(e),o=[...n.querySelectorAll("var")].filter((e=>je(e.textContent)===t&&e.closest("section")===n)),i=o[0].classList.contains("respec-hl");if(Li.set(r,i),i)return o.forEach((e=>Ri(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=Ti(t);n.forEach((t=>Ri(t,e))),[...Li.keys()].forEach((e=>Li.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const Li=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 Ti(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===Li.get("respec-hl-c1")?"respec-hl-c1":[...Li.keys()].find((e=>Li.get(e)))||"respec-hl-c1"}function Ri(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var Ni=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Ci,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",Ai))),o("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(Ri)}))}});var zi=String.raw`var{position:relative;cursor:pointer} +}`;function Li(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=Oe(e.textContent),n=e.closest("section"),r=Ri(e),o=[...n.querySelectorAll("var")].filter((e=>Oe(e.textContent)===t&&e.closest("section")===n)),i=o[0].classList.contains("respec-hl");if(Ti.set(r,i),i)return o.forEach((e=>Ni(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=Ri(t);n.forEach((t=>Ni(t,e))),[...Ti.keys()].forEach((e=>Ti.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const Ti=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 Ri(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===Ti.get("respec-hl-c1")?"respec-hl-c1":[...Ti.keys()].find((e=>Ti.get(e)))||"respec-hl-c1"}function Ni(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var zi=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Ai,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",Li))),o("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(Ni)}))}});var Pi=String.raw`var{position:relative;cursor:pointer} 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(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} +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=Pi,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 ji=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var Oi=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(ve`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=ji,document.head.appendChild(t)}});const Ii="core/anchor-expander";function Mi(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void et(`Found matching element "${t}", but it has no title or marker.`,Ii,{title:"Missing title.",elements:[n]})}const o=Ye(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 et(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Ii,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ye(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=Oe(i.textContent))}function Fi(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void et(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Ii,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ye(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=Oe(i.textContent))}function Bi(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Hi(r,n),Wi(r,n);else{n.textContent=n.getAttribute("href");et("Found matching section, but the section was lacking a heading element.",Ii,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Hi(e,t){const n=e.querySelector(".self-link"),r=[...Ye(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=He(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 Ui=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":Hi(n,t);break;case"section":Bi(n,e,t);break;case"figure":qi(n,e,t);break;case"table":Fi(n,e,t);break;case"aside":case"div":Mi(n,e,t);break;default:t.textContent=t.getAttribute("href");et("ReSpec doesn't support expanding this kind of reference.",Ii,{title:`Can't expand "#${e}".`,elements:[t]})}Wi(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");et(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Ii,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Vi=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 +439,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=we` +.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 Zi(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")||Oe(e.textContent),s=ve` <div class="dfn-panel" id="${o}" @@ -457,11 +456,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]")?we`<span + ${function(e){return e.matches("dfn[data-export]")?ve`<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 we`<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 ve`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -469,19 +468,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 we`<ul> + ${function(e,t){if(!t.length)return ve`<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=>we`<li> - ${r(e).map((e=>we`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} - </li>`;return we`<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?`§ ${Oe(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=>ve`<li> + ${r(e).map((e=>ve`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} + </li>`;return ve`<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(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;we.bind(this)` + `;return s}var Ki=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(ve`<style> + ${Vi} + </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(Zi(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 Es}))).default}catch{return bi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Yi=new Promise(((e,t)=>{}));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:"}});const Xi="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;ve.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&&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..."}} + ${{any:Qi(e,t,n).then((e=>async function(e){const{repoURL:t}=await Yi;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,i=r&&ve` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return ve`<li><a href="${o}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>et(e.message,Xi,{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 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})()'})}(); + `}};async function Qi(e,t,n){let r;try{const o=await Yi;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 Ji=[Object.freeze({__proto__:null,element:Gi,name:Xi})];var es=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ji.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ji.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 ts="core/linter-rules/check-charset",ns=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 rs=Object.freeze({__proto__:null,name:ts,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||tt(ns.msg,ts,{hint:ns.hint,elements:[...t]})}});const os="core/linter-rules/check-punctuation",is=[".",":","!","?"],ss=Ie({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${is.map((e=>`"${e}"`)).join(", ")}.`}});var as=Object.freeze({__proto__:null,name:os,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${is.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&tt(ss.msg,os,{hint:ss.hint,elements:n})}});const ls="core/linter-rules/local-refs-exist",cs=Ie({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function us(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var ds=Object.freeze({__proto__:null,name:ls,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(us);t.length&&tt(cs.msg,ls,{hint:cs.hint,elements:t})}});const ps="core/linter-rules/no-headingless-sections",hs=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 fs=Object.freeze({__proto__:null,name:ps,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&&tt(hs.msg,ps,{hint:hs.hint,elements:t})}});const ms="core/linter-rules/no-unused-vars",gs=Ie({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var bs=Object.freeze({__proto__:null,name:ms,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=Oe(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&&tt(gs.msg,ms,{hint:gs.hint,elements:t})}});const ys="core/linter-rules/privsec-section",ws=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 vs=Object.freeze({__proto__:null,name:ys,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})))&&tt(ws.msg,ys,{hint:ws.hint})}});const xs="core/linter-rules/no-http-props",ks=Ie({en:{msg:ot`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:ot`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var $s=Object.freeze({__proto__:null,name:xs,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=>ot`${`[${e}]`}`));tt(ks.msg,xs,{hint:ks.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'}),Es=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 b84114b11e..4a73845194 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.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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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,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,CAA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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,EAAEke,eAAeC,EAAEne,EAAEyY,eAAehN,EAAE2S,EAAEjc,UAAU,OAAOsJ,EAAE4S,OAAO,SAASre,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAErK,IAAI,SAASpB,GAAG,OAAO4C,KAAKb,IAAI/B,GAAGA,EAAE4C,KAAKoG,QAAG,CAAM,EAAEyC,EAAE1J,IAAI,SAAS/B,GAAG,OAAOme,EAAEpb,KAAK/C,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAE5J,IAAI,SAAS7B,EAAE+P,GAAG,OAAO9G,EAAEjJ,EAAE4C,KAAKoG,EAAE,CAACsV,cAAa,EAAGxc,MAAMiO,IAAInN,IAAI,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","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 getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\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 pluralize$1 = {exports: {}};\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 pluralizeExports = pluralize$1.exports;\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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","getDefaultExportFromCjs","x","__esModule","module","pluralize$1","exports","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","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","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,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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S,QACV7F,SAAQ,SAAU6F,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,WACA7F,QAAQqF,EAAU8B,oBAEb9B,CACV,IAGA,IACIA,GAAyBP,GADNI,GAAYC,SCjgBGmC,GAAU,SAASC,GAAgB,IAAIpO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,EAAEoe,eAAeC,EAAEre,EAAEyY,eAAehN,EAAE6S,EAAEnc,UAAU,OAAOsJ,EAAE8S,OAAO,SAASve,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAErK,IAAI,SAASpB,GAAG,OAAO4C,KAAKb,IAAI/B,GAAGA,EAAE4C,KAAKoG,QAAG,CAAM,EAAEyC,EAAE1J,IAAI,SAAS/B,GAAG,OAAOqe,EAAEtb,KAAK/C,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAE5J,IAAI,SAAS7B,EAAE+P,GAAG,OAAO9G,EAAEjJ,EAAE4C,KAAKo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uB,GAAI,CACFuZ,IAAK,yEACLgU,KACE,mMAgBC,SAAauL,GAVpB,IAAiChL,EAW1BgL,EAAKkH,OAxBK,oBA4BXlH,EAAKm4B,aAfsBnjC,EAeiBruB,UAdzC+f,MAAM2L,KAAK2C,EAAIrP,iBAAiB,uBAAuBtb,MAC5D,EAAG+gB,YAAahY,MACd,MAAMglD,EAAgB,uBAAuBhrD,KAAKgG,GAC5CilD,EAAqB,qBAAqBjrD,KAAKgG,GACrD,OAAQglD,GAAiBC,GAAuBD,CAAa,MAW/D/hC,GAAYrvB,GAAKyZ,IAAKzb,GAAM,CAAEyvB,KAAMztB,GAAKytB,MAE7C,ICnCA,MACazvB,GAAO,kCAYdgC,GAAO4uB,GAVe,CAC1B1uB,GAAI,CACFuZ,IAAKqa,EAAO,oCAAoC,oBAChDrG,KAAM,0DAERiX,GAAI,CACFjrB,IAAKqa,EAAO,GAAG,kCACfrG,KAAM,0EAKH,SAAauL,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKzhC,OAAOQ,SAASwK,KAAKyjB,WAAW,QACnC,OAGF,MAAMokC,EAAmBn8C,OAAOo8C,oBAAoBv4B,GAEjD3oB,QAAO4b,GAAQA,EAAI+H,SAAS,QAAUgF,EAAK/M,IAAiB,WAARA,IAEpD5b,QAAO4b,GACN,IAAIoB,IAAI2L,EAAK/M,GAAMxtB,OAAOQ,SAASwK,MAAMA,KAAKyjB,WAAW,aAG7D,GAAIokC,EAAiBnmD,OAAQ,CAC3B,MAAMsL,EAAOiY,GAAQ4iC,GAAkBrlC,GAAO6H,EAAO,GAAG,IAAI7H,SAC5DoD,GAAYrvB,GAAKyZ,IAAKzb,GAAM,CAAEyvB,KAAMztB,GAAKytB,KAAOhX,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 89aa96ad72..ef99ee861a 100644 --- a/builds/respec-geonovum.js +++ b/builds/respec-geonovum.js @@ -1,7 +1,6 @@ -window.respecVersion="33.0.2",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` +window.respecVersion="33.0.3",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;function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge,be={exports:{}};ge=be,function(e,t){ge.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 we=me(be.exports),ye=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);const ve=ye,xe=E,ke=he,$e=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=we;function Se(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:Se,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Se(e.innerHTML)}});const Ce=/-/g,Le=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"});"en"===l||l.startsWith("en-");function Ae(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 Te(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Re(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 Ne=Re("conjunction"),ze=Re("disjunction");function je(e,t){return Ne(e,t).join("")}function Pe(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 Oe(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){Ye(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function De(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>ve`${e}, `));return ve`${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 Me(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 Fe(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 He(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 Ge 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 Ve(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"),Ze(t),t}function Ze(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 Je 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:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n}}}function Xe(e,t,n={}){const o={...n,isWarning:!1};r("error",new Je(e,t,o))}function Ye(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Je(e,t,o))}function et(e){return e?`\`${e}\``:""}function tt(e,{quotes:t}={quotes:!1}){return ze(e,t?e=>et(nt(e)):et).join("")}function nt(e){return String(e)?`"${e}"`:""}function rt(e,...t){return Se(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 ot=new Map([["text/html","html"],["application/xml","xml"]]);function st(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=it(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function it(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ze(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Te(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=ve`<meta charset="utf-8" />`);s.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=ve` <meta name="generator" content="${l}" /> - `;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} + `;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:st});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 it("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 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(`${ut}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Xe("Every item in `preProcess` must be a JS function.",ct),t})).map((async t=>{try{return await t(e,document)}catch(e){Xe(`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 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||Xe("Every item in `postProcess` must be a JS function.",lt),t})).map((async t=>{try{return await t(e,document)}catch(e){Xe(`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"),Te(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} #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 +64,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,...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` +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const ft=/>/gm,ht=/&/gm;class mt extends ke.Renderer{code(e,t,n){const{language:r,...o}=mt.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 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 + `}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=Se(e).replace(ft,">").replace(ht,"&");return t.inline?ke.parseInline(n,gt):ke.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=He(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=ve`<div id="respec-ui" class="removeOnSave" hidden></div>`,_t=ve`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" hidden -></ul>`,_t=ye`<button +></ul>`,St=ve`<button class="close-button" - onclick=${()=>Pt.closeModal()} + onclick=${()=>It.closeModal()} title="Close" > ❌ -</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 +</button>`;let Et,Ct;window.addEventListener("load",(()=>zt(_t)));const Lt=[],At=[],Tt={};o("start-all",(()=>document.body.prepend($t)),{once:!0}),o("end-all",(()=>document.body.prepend($t)),{once:!0});const Rt=ve`<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 jt=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=ve`<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(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"> + ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=ve`<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)}It.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 s=1===t.length?_e.singular(r):r;kt(o,new Map([["label",`${t.length} ${s}`]]))}kt(Rt,jt);const It={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+/,"-")}`,s=ve`<button id="${o}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}… - </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 + </button>`,i=ve`<li role="menuitem">${s}</li>`;return i.addEventListener("click",t),_t.appendChild(i),s},error(e){Pt(e,Lt,"error","ReSpec Errors")},warning(e){Pt(e,At,"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"),Et&&(Et.remove(),Et=null,Rt.focus())},freshModal(e,t,n){Et&&Et.remove(),Ct&&Ct.remove(),Ct=ve`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;Et=ve`<div id="${r}" class="respec-modal removeOnSave" role="dialog" aria-labelledby="${o}" > - ${_t} + ${St} <h3 id="${o}">${e}</h3> <div class="inside">${t}</div> - </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{ + </div>`;const s=new Map([["labelledby",o]]);kt(Et,s),document.body.append(Ct,Et),Ct.addEventListener("click",(()=>this.closeModal(n))),Ct.classList.toggle("respec-show-overlay"),Et.hidden=!1,zt(Et)}};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> ${Se(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(Dt).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 Dt(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function qt(e){try{It.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await dt(e)}finally{It.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&It.closeModal()})),window.respecUI=It,o("error",(e=>It.error(e))),o("warn",(e=>It.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const Mt=[Promise.resolve().then((function(){return Bt})),Promise.resolve().then((function(){return c})),Promise.resolve().then((function(){return Ht})),Promise.resolve().then((function(){return Zt})),Promise.resolve().then((function(){return Yt})),Promise.resolve().then((function(){return tn})),Promise.resolve().then((function(){return ln})),Promise.resolve().then((function(){return gn})),Promise.resolve().then((function(){return xt})),Promise.resolve().then((function(){return Ee})),Promise.resolve().then((function(){return bn})),Promise.resolve().then((function(){return Er})),Promise.resolve().then((function(){return Or})),Promise.resolve().then((function(){return Dr})),Promise.resolve().then((function(){return Fr})),Promise.resolve().then((function(){return Vr})),Promise.resolve().then((function(){return Xr})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return Vn})),Promise.resolve().then((function(){return xo})),Promise.resolve().then((function(){return po})),Promise.resolve().then((function(){return or})),Promise.resolve().then((function(){return $o})),Promise.resolve().then((function(){return pn})),Promise.resolve().then((function(){return _o})),Promise.resolve().then((function(){return No})),Promise.resolve().then((function(){return jo})),Promise.resolve().then((function(){return Io})),Promise.resolve().then((function(){return Oo})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return Go})),Promise.resolve().then((function(){return Xo})),Promise.resolve().then((function(){return Yo})),Promise.resolve().then((function(){return is})),Promise.resolve().then((function(){return fs})),Promise.resolve().then((function(){return ws})),Promise.resolve().then((function(){return _s})),Promise.resolve().then((function(){return Es})),Promise.resolve().then((function(){return js})),Promise.resolve().then((function(){return Os})),Promise.resolve().then((function(){return Ms})),Promise.resolve().then((function(){return Us})),Promise.resolve().then((function(){return Zs})),Promise.resolve().then((function(){return Js})),Promise.resolve().then((function(){return ei})),Promise.resolve().then((function(){return ri})),Promise.resolve().then((function(){return ii}))];Promise.all(Mt).then((e=>qt(e))).catch((e=>console.error(e)));var Bt=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 Ft={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-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"}]]),Ut={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 Ht=Object.freeze({__proto__:null,name:"geonovum/defaults",run:function(e){const t=!1!==e.lint&&{...Ft.lint,...Ut.lint,...e.lint};Object.assign(e,{...Ft,...Ut,...e,lint:t}),Object.assign(e,function(e){return{isCCBY:"cc-by"===e.license,licenseInfo:Wt.get(e.license),isBasic:"GN-BASIS"===e.specStatus,isRegular:"GN-BASIS"===e.specStatus}}(e))}});var Gt=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -150,74 +149,74 @@ 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||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 +}`;const Vt=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Gt,document.head.appendChild(e),e}();var Zt=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Vt.remove()}});const Kt="geonovum/style";function Qt(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=`https://tools.geostandaarden.nl/respec/style/${e}.css`,t}const Jt=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(Ae))t.appendChild(n);return t}(),Xt=document.createElement("link");Xt.rel="shortcut icon",Xt.type="image/x-icon",Xt.href="https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico",document.head.prepend(Xt),document.head.querySelector("meta[name=viewport]")||Jt.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(Jt);var Yt=Object.freeze({__proto__:null,name:Kt,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.";e.specStatus="GN-BASIS",Ye(t,Kt)}document.body.querySelector("figure.scalable")&&(document.head.appendChild(Qt("leaflet")),document.head.appendChild(Qt("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 en={en:{status_at_publication:ve`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 <a href="https://www.geonovum.nl/geo-standaarden/alle-standaarden" >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a - >(in Dutch).`},nl:{status_at_publication:ye`Deze paragraaf beschrijft de status van dit + >(in Dutch).`},nl:{status_at_publication:ve`Deze paragraaf beschrijft de status van dit document ten tijde van publicatie. Het is mogelijk dat er actuelere versies van dit document bestaan. Een lijst van Geonovum publicaties en de 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=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 + >.`}};Object.keys(en).forEach((e=>{a[e]||(a[e]={}),Object.assign(a[e],en[e])}));var tn=Object.freeze({__proto__:null,name:"geonovum/l10n"});const nn="core/github";let rn,on;const sn=new Promise(((e,t)=>{rn=e,on=e=>{Xe(e,nn),t(new Error(e))}})),an=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 ln=Object.freeze({__proto__:null,github:sn,name:nn,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void rn(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=rt`Config option ${"[github]"} is missing property \`repoURL\`.`;return void on(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=rt`${"[github]"} configuration option is not a valid URL? (${n}).`;return void on(e)}if("https://github.com"!==t.origin){const e=rt`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void on(e)}const[r,o]=t.pathname.split("/").filter((e=>e));if(!r||!o){const e=rt`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void on(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{Ye("The `githubAPI` configuration option is private and should not be added manually.",nn)}if(!e.excludeGithubLinks){const n={key:an.participate,data:[{value:`GitHub ${r}/${o}`,href:t},{value:an.file_a_bug,href:l.issueBase},{value:an.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};rn(u);const d={...l,...e,github:u,githubAPI:c};Object.assign(e,d)}});class cn{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(un(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function un(e){const t=new cn(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 dn(e){const t=un(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 pn=Object.freeze({__proto__:null,name:"core/sections",restructure:dn,run:function(){dn(document.body)}});const fn="core/data-include";function hn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=Oe(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=bt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&dn(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 mn(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);hn(await o.text(),r,n),t<3&&await mn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Xe(r,fn,{elements:[e]})}}));await Promise.all(r)}var gn=Object.freeze({__proto__:null,name:fn,run:async function(){await mn(document,1)}});var bn=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Oe(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const wn=/^[a-z]+(\s+[a-z]+)+\??$/,yn=/\B"([^"]*)"\B/,vn=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,xn=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,kn=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,$n=/^(?:\w+)\??$/,_n=/^(\w+)\["([\w- ]*)"\]$/,Sn=/\.?(\w+\(.*\)$)/,En=/\/(.+)/,Cn=/\[\[.+\]\]/;function Ln(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return ve`<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: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 + >`}function An(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,l=a?ve`(${De(s,Tn)})`:null,c=a?`(${s.join(", ")})`:"";return ve`${n&&o?".":""}<a data-xref-type="${r}" data-link-type="${r}" 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})(.+)/),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 + >`}function Tn(e,t,n){if(t<n.length-1)return ve`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return ve`${o?"...":null}<var>${s}</var>`}function Rn(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return ve`${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 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 + >`}function Nn(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:l}=o||{},c=De(a||t,Tn),u=`${n}(${t.join(", ")})`;return ve`${o&&s?".":""}<a data-link-type="idl" data-xref-type="${r}" data-link-for="${l}" data-xref-for="${l}" data-lt="${u}" ><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 + >${!i||a?ve`<code>(${c})</code>`:""}`}function zn(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return ve`"<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 zn(e){const{identifier:t}=e;return ye`"<a + >"`}function jn(e){const{identifier:t}=e;return ve`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function jn(e){const{identifier:t,nullable:n}=e;return ye`<a + >"`}function Pn(e){const{identifier:t,nullable:n}=e;return ve`<a data-link-type="idl" data-cite="webidl" data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}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> + >`}function In(e){let t;try{t=function(e){const t=Cn.test(e),n=t?En:Sn,[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(vn.test(t)){const[,e,n,r,o]=t.match(vn),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(yn.test(t)){const[,e]=t.match(yn);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(xn.test(t)){const[,e,n]=t.match(xn),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(kn.test(t)&&s.length){const[,e]=t.match(kn);a.push({type:"attribute",identifier:e,renderParent:i})}else if(wn.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(!$n.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=ve`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Xe(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=ve(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Ln(e);t&&r.push(t);break}case"attribute":r.push(Rn(e));break;case"internal-slot":r.push(An(e));break;case"method":r.push(Nn(e));break;case"enum":r.push(zn(e));break;case"exception":r.push(jn(e));break;case"idl-primitive":r.push(Pn(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const On=new Set(["alias","reference"]),Dn=async function(){const e=await xe.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[...On]){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 qn={get ready(){return Dn},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!On.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(!On.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=[...On].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!On.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=[...On],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},Mn={},Bn=new URL("https://api.specref.org/bibrefs?refs="),Fn=Ae({hint:"dns-prefetch",href:Bn.origin});let Wn;document.head.appendChild(Fn);const Un=new Promise((e=>{Wn=e}));async function Hn(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(Bn.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 qn.addAll(o,e)}catch(e){console.error(e)}return o}async function Gn(e){const t=await Un;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Gn(n.aliasOf):n}var Vn=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=Mn;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 qn.ready;const n=e.map((async e=>({id:e,data:await qn.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=>{Mn[e.id]=e.data}));const s=o.noData.map((e=>e.id));if(s.length){const e=await Hn(s,{forceUpdate:!0});Object.assign(Mn,e)}Object.assign(Mn,this.conf.localBiblio),(()=>{Wn(this.conf.biblio)})()}},biblio:Mn,name:"core/biblio",resolveRef:Gn,updateFromNetwork:Hn});const Zn="core/render-biblio",Kn=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:"参考文献"}}),Qn=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"]]),Jn=(Xn=".",e=>{const t=e.trim();return!t||t.endsWith(Xn)?t:t+Xn});var Xn;function Yn(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(er)),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=ve`<section> <h3>${t}</h3> - <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 + <dl class="bibliography">${s.map(nr)}</dl> + </section>`;qe(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()));Xe(`Reference "[${t}]" not found.`,Zn,{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 er(e){let t=Mn[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Xe(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Zn)}else n=t.aliasOf,t=Mn[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function tr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=ve`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?o:ye`[${o}]`}function tr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return ye` + >`;return t?o:ve`[${o}]`}function nr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return ve` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:nr(n)}:ye`<em class="respec-offending-element" - >${Zn.reference_not_found}</em + ${n?{html:rr(n)}:ve`<em class="respec-offending-element" + >${Kn.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 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 + `}function rr(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} ${Jn(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Qn.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var or=Object.freeze({__proto__:null,name:Zn,renderInlineCitation:tr,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")||ve`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(ve`<h1>${Kn.references}</h1>`),r.classList.add("appendix"),n.length){const e=Yn(n,Kn.norm_references);r.appendChild(e)}if(t.length){const e=Yn(t,Kn.info_references);r.appendChild(e)}document.body.appendChild(r)}});const sr="core/inlines",ir={},ar=e=>new RegExp(e.map((e=>e.source)).join("|")),lr=Ie({en:{rfc2119Keywords:()=>ar([/\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:()=>ar([/\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/])}}),cr=/(?:`[^`]+`)(?!`)/,ur=/(?:{{[^}]+\?*}})/,dr=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,pr=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,fr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,hr=/(?:\[=[^=]+=\])/,mr=/(?:\[\^[^^]+\^\])/;function gr(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 ve`<code ><a data-xref-type="${s}" data-xref-for="${i}" @@ -225,26 +224,26 @@ dd{margin-left:0} data-link-for="${i}" >${a}</a ></code - >`}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 + >`}function br(e){const t=Pe(e),n=ve`<em class="rfc2119">${t}</em>`;return ir[t]=!0,n}function wr(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?ve`<a href="${t}" data-matched-text="${e}"></a>`:ve`<a data-cite="${t}" data-matched-text="${e}"></a>`}function yr(e,t){const n=Pe(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=In(n);return!!t.parentElement.closest("dfn")?_r(`\`${r.textContent}\``):r}function vr(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(Pe),{type:i,illegal:a}=Fe(o,t.parentElement),l=tr(o,s),c=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(c)){const e=l.childNodes[1]||l;Ye("Normative references in informative sections are not allowed. ",sr,{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 xr(e,t,n){return"ABBR"===t.parentElement.tagName?e:ve`<abbr title="${n.get(e)}">${e}</abbr>`}function kr(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return ve`<var data-type="${r}">${n}</var>`}function $r(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),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=Sr(s),a=n?Pe(n):null;return ve`<a data-link-type="dfn" data-link-for="${a}" data-xref-for="${a}" 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} + >`}function _r(e){const t=e.slice(1,-1);return ve`<code>${t}</code>`}function Sr(e){return cr.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?_r(e):Sr(e))):document.createTextNode(e)}var Er=Object.freeze({__proto__:null,name:sr,rfc2119Usage:ir,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ge,e.informativeReferences=new Ge,e.respecRFC2119||(e.respecRFC2119=ir);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)),s=[];let i;for(;i=o.nextNode();)s.push(i);return s}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),s=lr.rfc2119Keywords(),i=new RegExp(`(${ar([s,ur,dr,pr,fr,hr,cr,mr,...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(yr(i,n));break;case i.startsWith("[[["):o.append(wr(i));break;case i.startsWith("[["):o.append(...vr(i,n,e));break;case i.startsWith("|"):o.append(kr(i));break;case i.startsWith("[="):o.append($r(i));break;case i.startsWith("`"):o.append(_r(i));break;case i.startsWith("[^"):o.append(gr(i));break;case t.has(i):o.append(xr(i,n,t));break;case s.test(i):o.append(br(i))}else o.append(i);n.replaceWith(o)}}});function Cr(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Xe(`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 Lr(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Xe(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Ar=new Qe;function Tr(e,t){for(const n of t)Ar.has(n)||Ar.set(n,new Set),Ar.get(n).add(e)}const Rr="core/dfn",Nr=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Lr}],["element",{requiresFor:!1,validator:Cr}],["element-attr",{requiresFor:!1,validator:Cr}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Lr}],["event",{requiresFor:!1,validator:Lr}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new $e(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Xe(`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:Lr}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Lr(e.slice(1,-1),t,n,r):(Xe(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),zr=[...Nr.keys()];function jr(e,t){let n="";switch(!0){case zr.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Nr.has(e))),function(e,t,n){const r=Nr.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=rt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=rt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Xe(e,Rr,{hint:s,elements:[n]})}r.validator&&r.validator(e,t,n,Rr)}(t,n,e);break;case xn.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.`;Xe(`Internal slot "${e}" must be associated with a WebIDL interface.`,Rr,{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=rt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${tt(o,{quotes:!0})}. The slot "${e}" seems to be a "${et(r)}"?`;return Xe(n,Rr,{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 Pr(e){switch(!0){case e.matches(".export.no-export"):Xe(rt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Rr,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Xe(rt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Rr,{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 Or=Object.freeze({__proto__:null,name:Rr,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Me(e);if(Tr(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;jr(e,n),Pr(e),1===t.length&&n===Pe(e.textContent)||(e.dataset.lt=t.join("|"))}o("plugins-done",Ir)}});var Dr=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=Pe(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=Pe(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=Pe(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("|"),Tr(e,n)}}))}});var qr=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=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 +.example pre{background-color:rgba(0,0,0,.03)}`;const Mr=Ie({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function Br(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?ve`<span class="example-title">: ${n.title}</span>`:"";return ve`<div class="marker"> + <a class="self-link">${Mr.example}<bdi>${r}</bdi></a >${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: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}"> + </div>`}var Fr=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(ve`<style> + ${qr} + </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=Br(e,t,r);e.prepend(n);const s=qe(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=Br(e,n?0:t,r),a=ve`<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} + </div>`;qe(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var Wr=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 +253,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=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 +.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 Ur="core/issues-notes",Hr=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 Gr(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?Hr.feature_at_risk:Hr.issue:n?Hr.warning:r?Hr.editors_note:Hr.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=ve`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,c=document.createElement("span"),p=ve`<div role="heading" class="${`${s}-title marker`}">${c}</div>`;qe(p,"h",s);let f,h=i;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 ve`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return ve`<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){Ye(`Failed to fetch issue number ${u}.`,Ur)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?ve`<span style="text-transform: none">: ${t.title}</span>`:"";return ve`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Hr.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 ve` <a class="respec-gh-label" 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>`}(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>`,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>${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=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||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"> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return ve`<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=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(ve`<p>${Hr.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${Hr.issue_summary}</h1>`)}(o)}var Vr=Object.freeze({__proto__:null,name:Ur,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 Xe(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Ur),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(ve`<style> + ${Wr} + </style>`,o.querySelector("link")),Gr(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Zr="core/best-practices",Kr={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Qr=Ie(Kr),Jr=l in Kr?l:"en";var Xr=Object.freeze({__proto__:null,name:Zr,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=ve`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${Jr}">${Qr.best_practice}${t+1}</bdi></a + >`;if(n){const t=ve`<li>${o}: ${Ve(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=ve`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(ve`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Ye("Using best practices summary (#bp-summary) but no best practices found.",Zr),t.remove()}}});const Yr="core/figures",eo=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 to=Object.freeze({__proto__:null,name:Yr,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||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,ve`<span class="fig-title"></span>`),t.prepend(ve`<a class="self-link" href="#${e.id}" + >${eo.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")})),ve`<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"> + </li>`}(t.id,r));else{Ye("Found a `<figure>` without a `<figcaption>`.",Yr,{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(ve`<h1>${eo.list_of_figures}</h1>`,ve`<ul class="tof"> ${e} - </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"> + </ul>`))}});const no="core/data-cite",ro="__SPEC__";async function oo(e){const{key:t,frag:n,path:r,href:o}=e;let s="",i="";if(t===ro)s=document.location.href;else{const e=await Gn(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 so(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?We(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){Xe("Exporting an linked external definition is not allowed.",no,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function io(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const ao=io("#"),lo=io("/");function co(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?co(r):{key:ro,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=n.replace("#",""),co(e)}const i=r?`#${r}`:ao(n),a=o||lo(n).split("#")[0],{type:l}=Fe(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 uo(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 po=Object.freeze({__proto__:null,THIS_SPEC:ro,name:no,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 Gn(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Hn(n);r&&Object.assign(Mn,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=co(t),r=await oo(n);if(r)so(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Ye(n,no,{elements:[t]})}}o("beforesave",uo)},toCiteDetails:co});const fo="core/link-to-dfn",ho=[],mo=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 go(e){const t=new Map,n=[];for(const r of Ar.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),qe(r,"dfn",e)}}return{result:t,duplicates:n}}function bo(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return Me(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 wo(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=yo(e)&&yo(t,n);r&&!o||We(e,document.createElement("code"))}(e,t),!r}function yo(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 vo(e){e.forEach((e=>{Ye(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,fo,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var xo=Object.freeze({__proto__:null,name:fo,possibleExternalLinks:ho,run:async function(e){const t=function(){const e=new Qe;for(const t of Ar.keys()){const{result:n,duplicates:r}=go(t);e.set(t,n),r.length>0&&Xe(mo.duplicateMsg(t),fo,{title:mo.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){ho.push(e);continue}const r=bo(e,t);if(r){wo(e,r,t)||ho.push(e)}else""===e.dataset.cite?n.push(e):ho.push(e)}vo(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!==ro&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||vo(ho)}});const ko="core/contrib";var $o=Object.freeze({__proto__:null,name:ko,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Xe(rt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,ko)}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 ve(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 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 Xe("Error loading contributors from GitHub.",ko),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);Be(e,`h${t}`)}))}});const So=["h2","h3","h4","h5","h6"],Eo="core/structure",Co=Ie({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Lo(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=ve`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?Ao(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(ve`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Ro(a.header,n),o=Lo(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function Ao(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function To(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(!So.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:To(e)})}return n}function Ro(e,t){const n=ve`<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")})),ve`<li class="tocline">${n}</li>`}var No=Object.freeze({__proto__:null,name:Eo,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)){Xe("`data-max-toc` must have a value between 0-6 (inclusive).",Eo,{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=Lo(To(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=ve`<nav id="toc"></nav>`,n=ve`<h2 class="introductory">${Co.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=ve`<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 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 + </p>`;document.body.append(o)}(t)}r("toc")}});const zo=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 jo=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(ve`<p><em>${zo.informative}</em></p>`)}))}});const Po=Ie({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Pe(t.textContent)}`),n}}});var Io=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=Po.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=ve`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=ve`<a href="#${t}" class="self-link" aria-label="${r}" - ></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` + ></a>`;o.append(n,s)}}});var Oo=Object.freeze({__proto__:null,name:"geonovum/conformance",run:function(){const e=document.querySelector("section#conformance");e&&function(e){const t=ve` <h2>Conformiteit</h2> <p> Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle @@ -284,20 +283,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 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 + `;e.prepend(...t.childNodes)}(e)}});const Do="ui/save-html",qo=Ie({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Mo=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return st(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return st(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 Bo(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return Le.format(e).replace(Ce,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return ve`<a href="${r}" id="${n}" download="${l}.${o}" type="${i}" class="respec-save-button" - onclick=${()=>Pt.closeModal()} + onclick=${()=>It.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` + >`}var Fo=Object.freeze({__proto__:null,exportDocument:function(e,t){return Ye("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Do,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),st(t)},name:Do,run:function(e){const t={async show(t){await document.respec.ready;const n=ve`<div class="respec-save-buttons"> + ${Mo.map((t=>Bo(t,e)))} + </div>`;It.freshModal(qo.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=It.addCommand(qo.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Wo="https://respec.org/specref/",Uo=Ie({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),Ho=It.addCommand(Uo.search_specref,(function(){const e=ve` + <iframe class="respec-iframe" src="${Wo}" onload=${e=>e.target.classList.add("ready")}></iframe> + <a href="${Wo}" target="_blank">Open Search UI in a new tab</a> + `;It.freshModal(Uo.search_specref,e,Ho)}),"Ctrl+Shift+Alt+space","🔎");var Go=Object.freeze({__proto__:null});const Vo=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 Zo=document.createElement("div"),Ko=ve.bind(Zo),Qo=It.addCommand(`${Vo.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(Jo).forEach((t=>{e.push(t)}));Ko` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -321,12 +320,12 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} </thead> <tbody>${e}</tbody> </table> -`,Pt.freshModal(`${Go.about_respec} - ${window.respecVersion}`,Vo,Ko)}),"Ctrl+Shift+Alt+A","ℹ️");function Qo({name:e,duration:t}){return ye` +`,It.freshModal(`${Vo.about_respec} - ${window.respecVersion}`,Zo,Qo)}),"Ctrl+Shift+Alt+A","ℹ️");function Jo({name:e,duration:t}){return ve` <tr> <td><a href="${`https://github.com/w3c/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}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} + `}var Xo=Object.freeze({__proto__:null});var Yo=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 es=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 +336,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 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` +.hljs-link{text-decoration:underline}`;async function ts(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 ns=Ae({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(ns);const rs=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return ai}))).default}catch{return ts("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",rs.then((e=>({worker:e}))));const os=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function ss(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:os(),languages:t},r=await rs;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 is=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(ss);document.head.appendChild(ve`<style> + ${es} + </style>`),await Promise.all(n)}});const as=Ie({en:{missing_test_suite_uri:rt`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:rt`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:rt`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:rt`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),ls="core/data-tests";function cs(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 ve` <li> <a href="${e}">${o}</a> ${t} </li> - `}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` + `}function us(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{Ye(rt`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,ls,{elements:[n]})}})).filter((e=>e))}function ds(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=rt`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=rt`To fix, remove duplicates from ${"[data-tests]"}: ${function(e,{quotes:t}={quotes:!1}){return je(e,t?e=>et(nt(e)):et)}(n,{quotes:!0})}.`;Ye(e,ls,{hint:r,elements:[t]})}}function ps(e){const t=[...new Set(e)];return ve` <details class="respec-tests-details removeOnSave"> <summary>tests: ${t.length}</summary> <ul> - ${t.map(ls)} + ${t.map(cs)} </ul> </details> - `}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 fs=Object.freeze({__proto__:null,name:ls,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=us(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);ds(t,n);const r=ps(t);n.append(r)}else Xe(as.missing_test_suite_uri,ls)}});const hs="core/list-sorter";function ms(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function gs(e,t){return[...e.querySelectorAll(":scope > li")].sort(ms(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function bs(e,t){return[...e.querySelectorAll(":scope > dt")].sort(ms(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 ws=Object.freeze({__proto__:null,name:hs,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=bs(t,n);break;case"ol":case"ul":e=gs(t,n);break;default:Ye(`ReSpec can't sort ${t.localName} elements.`,hs,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:bs,sortListItems:gs});var ys=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 +361,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 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} +}`;function vs(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=Pe(e.textContent),n=e.closest("section"),r=ks(e),o=[...n.querySelectorAll("var")].filter((e=>Pe(e.textContent)===t&&e.closest("section")===n)),s=o[0].classList.contains("respec-hl");if(xs.set(r,s),s)return o.forEach((e=>$s(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=ks(t);n.forEach((t=>$s(t,e))),[...xs.keys()].forEach((e=>xs.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const xs=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 ks(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===xs.get("respec-hl-c1")?"respec-hl-c1":[...xs.keys()].find((e=>xs.get(e)))||"respec-hl-c1"}function $s(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=ys,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",vs))),o("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach($s)}))}});var Ss=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var Es=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(ve`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=Ss,document.head.appendChild(t)}});const Cs="core/anchor-expander";function Ls(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Xe(`Found matching element "${t}", but it has no title or marker.`,Cs,{title:"Missing title.",elements:[n]})}const o=Ve(r);n.append(...o.childNodes),n.classList.add("box-ref")}function As(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Xe(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Cs,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ve(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=Pe(s.textContent))}function Ts(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Xe(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Cs,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ve(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=Pe(s.textContent))}function Rs(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Ns(r,n),zs(r,n);else{n.textContent=n.getAttribute("href");Xe("Found matching section, but the section was lacking a heading element.",Cs,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Ns(e,t){const n=e.querySelector(".self-link"),r=[...Ve(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 zs(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 js=Object.freeze({__proto__:null,name:Cs,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":Ns(n,t);break;case"section":Rs(n,e,t);break;case"figure":As(n,e,t);break;case"table":Ts(n,e,t);break;case"aside":case"div":Ls(n,e,t);break;default:t.textContent=t.getAttribute("href");Xe("ReSpec doesn't support expanding this kind of reference.",Cs,{title:`Can't expand "#${e}".`,elements:[t]})}zs(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Xe(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Cs,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Ps=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,7 +378,7 @@ 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 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` +.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 Is(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")||Pe(e.textContent),i=ve` <div class="dfn-panel" id="${o}" @@ -396,11 +395,11 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} aria-label="Permalink for definition: ${s}. 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]")?ve`<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 ve`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -408,15 +407,15 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} >`}}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 ve`<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 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> + </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?`§ ${Pe(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=>ve`<li> + ${r(e).map((e=>ve`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} + </li>`;return ve`<ul> ${[...n].map(o)} </ul>`}(t,r)} </div> - `;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})()'})}(); + `;return i}var Os=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(ve`<style> + ${Ps} + </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(Is(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 li}))).default}catch{return ts("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Ds="core/linter-rules/check-charset",qs=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 Ms=Object.freeze({__proto__:null,name:Ds,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||Ye(qs.msg,Ds,{hint:qs.hint,elements:[...t]})}});const Bs="core/linter-rules/check-punctuation",Fs=[".",":","!","?"],Ws=Ie({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Fs.map((e=>`"${e}"`)).join(", ")}.`}});var Us=Object.freeze({__proto__:null,name:Bs,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Fs.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Ye(Ws.msg,Bs,{hint:Ws.hint,elements:n})}});const Hs="core/linter-rules/local-refs-exist",Gs=Ie({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Vs(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Zs=Object.freeze({__proto__:null,name:Hs,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Vs);t.length&&Ye(Gs.msg,Hs,{hint:Gs.hint,elements:t})}});const Ks="core/linter-rules/no-headingless-sections",Qs=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 Js=Object.freeze({__proto__:null,name:Ks,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&&Ye(Qs.msg,Ks,{hint:Qs.hint,elements:t})}});const Xs="core/linter-rules/no-unused-vars",Ys=Ie({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var ei=Object.freeze({__proto__:null,name:Xs,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&&Ye(Ys.msg,Xs,{hint:Ys.hint,elements:t})}});const ti="core/linter-rules/privsec-section",ni=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 ri=Object.freeze({__proto__:null,name:ti,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})))&&Ye(ni.msg,ti,{hint:ni.hint})}});const oi="core/linter-rules/no-http-props",si=Ie({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 ii=Object.freeze({__proto__:null,name:oi,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=>rt`${`[${e}]`}`));Ye(si.msg,oi,{hint:si.hint+e})}}}),ai=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'}),li=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 e3f38f9999..c3db5b148f 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.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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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,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,GA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E,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,EAAEke,eAAeC,EAAEne,EAAEyY,eAAehN,EAAE2S,EAAEjc,UAAU,OAAOsJ,EAAE4S,OAAO,SAASre,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAErK,IAAI,SAASpB,GAAG,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AuBD,CAAa,MAW/Dl9B,GAAYjvB,GAAKyZ,IAAKzb,GAAM,CAAEqvB,KAAMrtB,GAAKqtB,MAE7C,ICnCA,MACarvB,GAAO,kCAYdgC,GAAOwuB,GAVe,CAC1BtuB,GAAI,CACFuZ,IAAKka,EAAO,oCAAoC,oBAChDtG,KAAM,0DAER0V,GAAI,CACFtpB,IAAKka,EAAO,GAAG,kCACftG,KAAM,0EAKH,SAAawL,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKthC,OAAOQ,SAASwK,KAAKsjB,WAAW,QACnC,OAGF,MAAMs/B,EAAmBl3C,OAAOm3C,oBAAoBzzB,GAEjDxoB,QAAO0b,GAAQA,EAAI8H,SAAS,QAAUgF,EAAK9M,IAAiB,WAARA,IAEpD1b,QAAO0b,GACN,IAAIkB,IAAI4L,EAAK9M,GAAMttB,OAAOQ,SAASwK,MAAMA,KAAKsjB,WAAW,aAG7D,GAAIs/B,EAAiBlhD,OAAQ,CAC3B,MAAMsL,EAAO6X,GAAQ+9B,GAAkBtgC,GAAO4H,EAAO,GAAG,IAAI5H,SAC5DkD,GAAYjvB,GAAKyZ,IAAKzb,GAAM,CAAEqvB,KAAMrtB,GAAKqtB,KAAO5W,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 getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\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 pluralize$1 = {exports: {}};\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 pluralizeExports = pluralize$1.exports;\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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","getDefaultExportFromCjs","x","__esModule","module","pluralize$1","exports","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","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","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,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,OAA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F,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,QACV7F,SAAQ,SAAU6F,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,WACA7F,QAAQqF,EAAU8B,oBAEb9B,CACV,IAGA,IACIA,GAAyBP,GADNI,GAAYC,SCjgBGmC,GAAU,SAASC,GAAgB,IAAIpO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,EAAEoe,eAAeC,EAAEre,EAAEyY,eAAehN,EAAE6S,EAAEnc,UAAU,OAAOsJ,EAAE8S,OAAO,SAASve,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKoG,EAAE,EA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ICnCA,MACavvB,GAAO,kCAYdgC,GAAO0uB,GAVe,CAC1BxuB,GAAI,CACFuZ,IAAKoa,EAAO,oCAAoC,oBAChDtG,KAAM,0DAER0V,GAAI,CACFxpB,IAAKoa,EAAO,GAAG,kCACftG,KAAM,0EAKH,SAAawL,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKxhC,OAAOQ,SAASwK,KAAKwjB,WAAW,QACnC,OAGF,MAAMs/B,EAAmBp3C,OAAOq3C,oBAAoBzzB,GAEjD1oB,QAAO4b,GAAQA,EAAI8H,SAAS,QAAUgF,EAAK9M,IAAiB,WAARA,IAEpD5b,QAAO4b,GACN,IAAIkB,IAAI4L,EAAK9M,GAAMxtB,OAAOQ,SAASwK,MAAMA,KAAKwjB,WAAW,aAG7D,GAAIs/B,EAAiBphD,OAAQ,CAC3B,MAAMsL,EAAO+X,GAAQ+9B,GAAkBtgC,GAAO4H,EAAO,GAAG,IAAI5H,SAC5DkD,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-highlight.js b/builds/respec-highlight.js index 524dcfaf2c..3efff3b83a 100644 --- a/builds/respec-highlight.js +++ b/builds/respec-highlight.js @@ -1 +1 @@ -var hljs=function(){"use strict";var e={exports:{}};function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||n(i)})),e}e.exports=n,e.exports.default=n;class t{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const r=e=>!!e.scope||e.sublanguage&&e.language;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!r(e))return;let n="";n=e.sublanguage?`language-${e.language}`:((e,{prefix:n})=>{if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(n)}closeNode(e){r(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const s=(e={})=>{const n={children:[]};return Object.assign(n,e),n};class c{constructor(){this.rootNode=s(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=s({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{c._collapse(e)})))}}class l extends c{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.sublanguage=!0,t.language=n,this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){return!0}}function d(e){return e?"string"==typeof e?e:e.source:null}function g(e){return h("(?=",e,")")}function u(e){return h("(?:",e,")*")}function b(e){return h("(?:",e,")?")}function h(...e){return e.map((e=>d(e))).join("")}function m(...e){const n=function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e);return"("+(n.capture?"":"?:")+e.map((e=>d(e))).join("|")+")"}function p(e){return new RegExp(e.toString()+"|").exec("").length-1}const f=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function y(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let i=d(e),a="";for(;i.length>0;){const e=f.exec(i);if(!e){a+=i;break}a+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+n):(a+=e[0],"("===e[0]&&t++)}return a})).map((e=>`(${e})`)).join(n)}const E="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",x="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",k={begin:"\\\\[\\s\\S]",relevance:0},N={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[k]},A={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[k]},O=function(e,n,t={}){const i=a({scope:"comment",begin:e,end:n,contains:[]},t);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:h(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},S=O("//","$"),M=O("/\\*","\\*/"),R=O("#","$"),T={scope:"number",begin:x,relevance:0},I={scope:"number",begin:_,relevance:0},C={scope:"number",begin:v,relevance:0},L={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[k,{begin:/\[/,end:/\]/,relevance:0,contains:[k]}]}]},j={scope:"title",begin:E,relevance:0},B={scope:"title",begin:w,relevance:0},D={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var z=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:E,UNDERSCORE_IDENT_RE:w,NUMBER_RE:x,C_NUMBER_RE:_,BINARY_NUMBER_RE:v,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=h(n,/.*\b/,e.binary,/\b.*/)),a({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:k,APOS_STRING_MODE:N,QUOTE_STRING_MODE:A,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:O,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:M,HASH_COMMENT_MODE:R,NUMBER_MODE:T,C_NUMBER_MODE:I,BINARY_NUMBER_MODE:C,REGEXP_MODE:L,TITLE_MODE:j,UNDERSCORE_TITLE_MODE:B,METHOD_GUARD:D,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}});function P(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function U(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function $(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=P,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function H(e,n){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function Z(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function F(e,n){void 0===e.relevance&&(e.relevance=1)}const G=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=h(t.beforeMatch,g(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},K=["of","and","for","in","not","or","if","then","parent","list","value"];function W(e,n,t="keyword"){const i=Object.create(null);return"string"==typeof e?a(t,e.split(" ")):Array.isArray(e)?a(t,e):Object.keys(e).forEach((function(t){Object.assign(i,W(e[t],n,t))})),i;function a(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");i[t[0]]=[e,X(t[0],t[1])]}))}}function X(e,n){return n?Number(n):function(e){return K.includes(e.toLowerCase())}(e)?0:1}const Q={},q=e=>{console.error(e)},V=(e,...n)=>{console.log(`WARN: ${e}`,...n)},J=(e,n)=>{Q[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),Q[`${e}/${n}`]=!0)},Y=new Error;function ee(e,n,{key:t}){let i=0;const a=e[t],r={},o={};for(let e=1;e<=n.length;e++)o[e+i]=a[e],r[e+i]=!0,i+=p(n[e-1]);e[t]=o,e[t]._emit=r,e[t]._multi=!0}function ne(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw q("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Y;if("object"!=typeof e.beginScope||null===e.beginScope)throw q("beginScope must be object"),Y;ee(e,e.begin,{key:"beginScope"}),e.begin=y(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw q("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Y;if("object"!=typeof e.endScope||null===e.endScope)throw q("endScope must be object"),Y;ee(e,e.end,{key:"endScope"}),e.end=y(e.end,{joinWith:""})}}(e)}function te(e){function n(n,t){return new RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(y(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),i=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),function t(r,o){const s=r;if(r.isCompiled)return s;[U,Z,ne,G].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))),r.__beforeBegin=null,[$,H,F].forEach((e=>e(r,o))),r.isCompiled=!0;let c=null;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),c=r.keywords.$pattern,delete r.keywords.$pattern),c=c||/\w+/,r.keywords&&(r.keywords=W(r.keywords,e.case_insensitive)),s.keywordPatternRe=n(c,!0),o&&(r.begin||(r.begin=/\B|\b/),s.beginRe=n(s.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(s.endRe=n(s.end)),s.terminatorEnd=d(s.end)||"",r.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),r.illegal&&(s.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return a(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(ie(e))return a(e,{starts:e.starts?a(e.starts):null});if(Object.isFrozen(e))return a(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,s)})),r.starts&&t(r.starts,o),s.matcher=function(e){const n=new i;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(s),s}(e)}function ie(e){return!!e&&(e.endsWithParent||ie(e.starts))}class ae extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const re=i,oe=a,se=Symbol("nomatch");var ce=function(n){const i=Object.create(null),a=Object.create(null),r=[];let o=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let d={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:l};function p(e){return d.noHighlightRe.test(e)}function f(e,n,t){let i="",a="";"object"==typeof n?(i=e,t=n.ignoreIllegals,a=n.language):(J("10.7.0","highlight(lang, code, ...args) has been deprecated."),J("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,i=n),void 0===t&&(t=!0);const r={code:i,language:a};A("before:highlight",r);const o=r.result?r.result:y(r.language,r.code,t);return o.code=r.code,A("after:highlight",o),o}function y(e,n,a,r){const c=Object.create(null);function l(){if(!N.keywords)return void O.addText(S);let e=0;N.keywordPatternRe.lastIndex=0;let n=N.keywordPatternRe.exec(S),t="";for(;n;){t+=S.substring(e,n.index);const a=x.case_insensitive?n[0].toLowerCase():n[0],r=(i=a,N.keywords[i]);if(r){const[e,i]=r;if(O.addText(t),t="",c[a]=(c[a]||0)+1,c[a]<=7&&(M+=i),e.startsWith("_"))t+=n[0];else{const t=x.classNameAliases[e]||e;O.addKeyword(n[0],t)}}else t+=n[0];e=N.keywordPatternRe.lastIndex,n=N.keywordPatternRe.exec(S)}var i;t+=S.substring(e),O.addText(t)}function g(){null!=N.subLanguage?function(){if(""===S)return;let e=null;if("string"==typeof N.subLanguage){if(!i[N.subLanguage])return void O.addText(S);e=y(N.subLanguage,S,!0,A[N.subLanguage]),A[N.subLanguage]=e._top}else e=E(S,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(M+=e.relevance),O.addSublanguage(e._emitter,e.language)}():l(),S=""}function u(e,n){let t=1;const i=n.length-1;for(;t<=i;){if(!e._emit[t]){t++;continue}const i=x.classNameAliases[e[t]]||e[t],a=n[t];i?O.addKeyword(a,i):(S=a,l(),S=""),t++}}function b(e,n){return e.scope&&"string"==typeof e.scope&&O.openNode(x.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(O.addKeyword(S,x.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),S=""):e.beginScope._multi&&(u(e.beginScope,n),S="")),N=Object.create(e,{parent:{value:N}}),N}function h(e,n,i){let a=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,i);if(a){if(e["on:end"]){const i=new t(e);e["on:end"](n,i),i.isMatchIgnored&&(a=!1)}if(a){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return h(e.parent,n,i)}function m(e){return 0===N.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function p(e){const t=e[0],i=n.substring(e.index),a=h(N,e,i);if(!a)return se;const r=N;N.endScope&&N.endScope._wrap?(g(),O.addKeyword(t,N.endScope._wrap)):N.endScope&&N.endScope._multi?(g(),u(N.endScope,e)):r.skip?S+=t:(r.returnEnd||r.excludeEnd||(S+=t),g(),r.excludeEnd&&(S=t));do{N.scope&&O.closeNode(),N.skip||N.subLanguage||(M+=N.relevance),N=N.parent}while(N!==a.parent);return a.starts&&b(a.starts,e),r.returnEnd?0:t.length}let f={};function w(i,r){const s=r&&r[0];if(S+=i,null==s)return g(),0;if("begin"===f.type&&"end"===r.type&&f.index===r.index&&""===s){if(S+=n.slice(r.index,r.index+1),!o){const n=new Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=f.rule,n}return 1}if(f=r,"begin"===r.type)return function(e){const n=e[0],i=e.rule,a=new t(i),r=[i.__beforeBegin,i["on:begin"]];for(const t of r)if(t&&(t(e,a),a.isMatchIgnored))return m(n);return i.skip?S+=n:(i.excludeBegin&&(S+=n),g(),i.returnBegin||i.excludeBegin||(S=n)),b(i,e),i.returnBegin?0:n.length}(r);if("illegal"===r.type&&!a){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(N.scope||"<unnamed>")+'"');throw e.mode=N,e}if("end"===r.type){const e=p(r);if(e!==se)return e}if("illegal"===r.type&&""===s)return 1;if(T>1e5&&T>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return S+=s,s.length}const x=v(e);if(!x)throw q(s.replace("{}",e)),new Error('Unknown language: "'+e+'"');const _=te(x);let k="",N=r||_;const A={},O=new d.__emitter(d);!function(){const e=[];for(let n=N;n!==x;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>O.openNode(e)))}();let S="",M=0,R=0,T=0,I=!1;try{for(N.matcher.considerAll();;){T++,I?I=!1:N.matcher.considerAll(),N.matcher.lastIndex=R;const e=N.matcher.exec(n);if(!e)break;const t=w(n.substring(R,e.index),e);R=e.index+t}return w(n.substring(R)),O.closeAllNodes(),O.finalize(),k=O.toHTML(),{language:e,value:k,relevance:M,illegal:!1,_emitter:O,_top:N}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:re(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:R,context:n.slice(R-100,R+100),mode:t.mode,resultSoFar:k},_emitter:O};if(o)return{language:e,value:re(n),illegal:!1,relevance:0,errorRaised:t,_emitter:O,_top:N};throw t}}function E(e,n){n=n||d.languages||Object.keys(i);const t=function(e){const n={value:re(e),illegal:!1,relevance:0,_top:c,_emitter:new d.__emitter(d)};return n._emitter.addText(e),n}(e),a=n.filter(v).filter(N).map((n=>y(n,e,!1)));a.unshift(t);const r=a.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(v(e.language).supersetOf===n.language)return 1;if(v(n.language).supersetOf===e.language)return-1}return 0})),[o,s]=r,l=o;return l.secondBest=s,l}function w(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=d.languageDetectRe.exec(n);if(t){const n=v(t[1]);return n||(V(s.replace("{}",t[1])),V("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>p(e)||v(e)))}(e);if(p(t))return;if(A("before:highlightElement",{el:e,language:t}),e.children.length>0&&(d.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),d.throwUnescapedHTML)){throw new ae("One of your code blocks includes unescaped HTML.",e.innerHTML)}n=e;const i=n.textContent,r=t?f(i,{language:t,ignoreIllegals:!0}):E(i);e.innerHTML=r.value,function(e,n,t){const i=n&&a[n]||t;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,t,r.language),e.result={language:r.language,re:r.relevance,relevance:r.relevance},r.secondBest&&(e.secondBest={language:r.secondBest.language,relevance:r.secondBest.relevance}),A("after:highlightElement",{el:e,result:r,text:i})}let x=!1;function _(){if("loading"===document.readyState)return void(x=!0);document.querySelectorAll(d.cssSelector).forEach(w)}function v(e){return e=(e||"").toLowerCase(),i[e]||i[a[e]]}function k(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{a[e.toLowerCase()]=n}))}function N(e){const n=v(e);return n&&!n.disableAutodetect}function A(e,n){const t=e;r.forEach((function(e){e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){x&&_()}),!1),Object.assign(n,{highlight:f,highlightAuto:E,highlightAll:_,highlightElement:w,highlightBlock:function(e){return J("10.7.0","highlightBlock will be removed entirely in v12.0"),J("10.7.0","Please use highlightElement now."),w(e)},configure:function(e){d=oe(d,e)},initHighlighting:()=>{_(),J("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){_(),J("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(e,t){let a=null;try{a=t(n)}catch(n){if(q("Language definition for '{}' could not be registered.".replace("{}",e)),!o)throw n;q(n),a=c}a.name||(a.name=e),i[e]=a,a.rawDefinition=t.bind(null,n),a.aliases&&k(a.aliases,{languageName:e})},unregisterLanguage:function(e){delete i[e];for(const n of Object.keys(a))a[n]===e&&delete a[n]},listLanguages:function(){return Object.keys(i)},getLanguage:v,registerAliases:k,autoDetection:N,inherit:oe,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),r.push(e)}}),n.debugMode=function(){o=!1},n.safeMode=function(){o=!0},n.versionString="11.7.0",n.regex={concat:h,lookahead:g,either:m,optional:b,anyNumberOfTimes:u};for(const n in z)"object"==typeof z[n]&&e.exports(z[n]);return Object.assign(n,z),n}({}),le=ce;ce.HighlightJS=ce,ce.default=ce;var de=le;const ge=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ue=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],be=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],he=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],me=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();const pe="[A-Za-z$_][0-9A-Za-z$_]*",fe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],ye=["true","false","null","undefined","NaN","Infinity"],Ee=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],we=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_e=["arguments","this","super","console","window","document","localStorage","module","global"],ve=[].concat(xe,Ee,we);return de.configure({tabReplace:" ",languages:["abnf","css","http","javascript","json","xml"]}),de.registerLanguage("abnf",(function(e){const n=e.regex,t=e.COMMENT(/;/,/$/);return{name:"Augmented Backus-Naur Form",illegal:/[!@#$^&',?+~`|:]/,keywords:["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],contains:[{scope:"operator",match:/=\/?/},{scope:"attribute",match:n.concat(/^[a-zA-Z][a-zA-Z0-9-]*/,/(?=\s*=)/)},t,{scope:"symbol",match:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/},{scope:"symbol",match:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/},{scope:"symbol",match:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/},{scope:"symbol",match:/%[si](?=".*")/},e.QUOTE_STRING_MODE,e.NUMBER_MODE]}})),de.registerLanguage("css",(function(e){const n=e.regex,t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),i=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+be.join("|")+")"},{begin:":(:)?("+he.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+me.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...i,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...i,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ue.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...i,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ge.join("|")+")\\b"}]}})),de.registerLanguage("http",(function(e){const n="HTTP/(2|1\\.[01])",t={className:"attribute",begin:e.regex.concat("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},i=[t,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+n+" \\d{3})",end:/$/,contains:[{className:"meta",begin:n},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},{begin:"(?=^[A-Z]+ (.*?) "+n+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:n},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},e.inherit(t,{relevance:0})]}})),de.registerLanguage("javascript",(function(e){const n=e.regex,t=pe,i="<>",a="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,i=e.input[t];if("<"===i||","===i)return void n.ignoreMatch();let a;">"===i&&(((e,{after:n})=>{const t="</"+e[0].slice(1);return-1!==e.input.indexOf(t,n)})(e,{after:t})||n.ignoreMatch());const r=e.input.substring(t);((a=r.match(/^\s*=/))||(a=r.match(/^\s+extends\s+/))&&0===a.index)&&n.ignoreMatch()}},o={$pattern:pe,keyword:fe,literal:ye,built_in:ve,"variable.language":_e},s="\\.([0-9](_?[0-9])*)",c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={className:"number",variants:[{begin:`(\\b(${c})((${s})|\\.)?|(${s}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{begin:`\\b(${c})\\b((${s})\\b|\\.)?|(${s})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},u={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},b={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},h={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},m=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,u,b,{match:/\$\d+/},l];d.contains=m.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(m)});const p=[].concat(h,d.contains),f=p.concat([{begin:/\(/,end:/\)/,keywords:o,contains:["self"].concat(p)}]),y={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:f},E={variants:[{match:[/class/,/\s+/,t,/\s+/,/extends/,/\s+/,n.concat(t,"(",n.concat(/\./,t),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,t],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ee,...we]}},x={variants:[{match:[/function/,/\s+/,t,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},_={match:n.concat(/\b/,(v=[...xe,"super","import"],n.concat("(?!",v.join("|"),")")),t,n.lookahead(/\(/)),className:"title.function",relevance:0};var v;const k={begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},N={match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:f,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,u,b,h,{match:/\$\d+/},l,w,{className:"attr",begin:t+n.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[h,e.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:f}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i,end:a},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},x,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:t,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+t,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},_,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},E,N,{match:/\$[(.]/}]}})),de.registerLanguage("json",(function(e){const n=["true","false","null"],t={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",keywords:{literal:n},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),de.registerLanguage("xml",(function(e){const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(a,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,s,o,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,r,s,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(t,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:c}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),de}(); +var hljs=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};function t(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(n){var i=e[n];"object"!=typeof i||Object.isFrozen(i)||t(i)})),e}n.exports=t,n.exports.default=t;class i{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const o=e=>!!e.scope||e.sublanguage&&e.language;class s{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=a(e)}openNode(e){if(!o(e))return;let n="";n=e.sublanguage?`language-${e.language}`:((e,{prefix:n})=>{if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(n)}closeNode(e){o(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const c=(e={})=>{const n={children:[]};return Object.assign(n,e),n};class l{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=c({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{l._collapse(e)})))}}class d extends l{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.sublanguage=!0,t.language=n,this.add(t)}toHTML(){return new s(this,this.options).value()}finalize(){return!0}}function g(e){return e?"string"==typeof e?e:e.source:null}function u(e){return m("(?=",e,")")}function b(e){return m("(?:",e,")*")}function h(e){return m("(?:",e,")?")}function m(...e){return e.map((e=>g(e))).join("")}function p(...e){const n=function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e);return"("+(n.capture?"":"?:")+e.map((e=>g(e))).join("|")+")"}function f(e){return new RegExp(e.toString()+"|").exec("").length-1}const y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let i=g(e),a="";for(;i.length>0;){const e=y.exec(i);if(!e){a+=i;break}a+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+n):(a+=e[0],"("===e[0]&&t++)}return a})).map((e=>`(${e})`)).join(n)}const w="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",_="\\b\\d+(\\.\\d+)?",v="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",N={begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[N]},A={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[N]},S=function(e,n,t={}){const i=r({scope:"comment",begin:e,end:n,contains:[]},t);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:m(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},M=S("//","$"),R=S("/\\*","\\*/"),T=S("#","$"),I={scope:"number",begin:_,relevance:0},C={scope:"number",begin:v,relevance:0},L={scope:"number",begin:k,relevance:0},j={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[N,{begin:/\[/,end:/\]/,relevance:0,contains:[N]}]}]},B={scope:"title",begin:w,relevance:0},D={scope:"title",begin:x,relevance:0},z={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var P=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:w,UNDERSCORE_IDENT_RE:x,NUMBER_RE:_,C_NUMBER_RE:v,BINARY_NUMBER_RE:k,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=m(n,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:N,APOS_STRING_MODE:O,QUOTE_STRING_MODE:A,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:S,C_LINE_COMMENT_MODE:M,C_BLOCK_COMMENT_MODE:R,HASH_COMMENT_MODE:T,NUMBER_MODE:I,C_NUMBER_MODE:C,BINARY_NUMBER_MODE:L,REGEXP_MODE:j,TITLE_MODE:B,UNDERSCORE_TITLE_MODE:D,METHOD_GUARD:z,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}});function U(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function $(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function H(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=U,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Z(e,n){Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function F(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function G(e,n){void 0===e.relevance&&(e.relevance=1)}const K=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=m(t.beforeMatch,u(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},W=["of","and","for","in","not","or","if","then","parent","list","value"];function X(e,n,t="keyword"){const i=Object.create(null);return"string"==typeof e?a(t,e.split(" ")):Array.isArray(e)?a(t,e):Object.keys(e).forEach((function(t){Object.assign(i,X(e[t],n,t))})),i;function a(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");i[t[0]]=[e,Q(t[0],t[1])]}))}}function Q(e,n){return n?Number(n):function(e){return W.includes(e.toLowerCase())}(e)?0:1}const q={},V=e=>{console.error(e)},J=(e,...n)=>{console.log(`WARN: ${e}`,...n)},Y=(e,n)=>{q[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),q[`${e}/${n}`]=!0)},ee=new Error;function ne(e,n,{key:t}){let i=0;const a=e[t],r={},o={};for(let e=1;e<=n.length;e++)o[e+i]=a[e],r[e+i]=!0,i+=f(n[e-1]);e[t]=o,e[t]._emit=r,e[t]._multi=!0}function te(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw V("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ee;if("object"!=typeof e.beginScope||null===e.beginScope)throw V("beginScope must be object"),ee;ne(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw V("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ee;if("object"!=typeof e.endScope||null===e.endScope)throw V("endScope must be object"),ee;ne(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}}(e)}function ie(e){function n(n,t){return new RegExp(g(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=f(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(E(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),i=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=r(e.classNameAliases||{}),function t(a,o){const s=a;if(a.isCompiled)return s;[$,F,te,K].forEach((e=>e(a,o))),e.compilerExtensions.forEach((e=>e(a,o))),a.__beforeBegin=null,[H,Z,G].forEach((e=>e(a,o))),a.isCompiled=!0;let c=null;return"object"==typeof a.keywords&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),c=a.keywords.$pattern,delete a.keywords.$pattern),c=c||/\w+/,a.keywords&&(a.keywords=X(a.keywords,e.case_insensitive)),s.keywordPatternRe=n(c,!0),o&&(a.begin||(a.begin=/\B|\b/),s.beginRe=n(s.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(s.endRe=n(s.end)),s.terminatorEnd=g(s.end)||"",a.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(s.illegalRe=n(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return r(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(ae(e))return r(e,{starts:e.starts?r(e.starts):null});if(Object.isFrozen(e))return r(e);return e}("self"===e?a:e)}))),a.contains.forEach((function(e){t(e,s)})),a.starts&&t(a.starts,o),s.matcher=function(e){const n=new i;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(s),s}(e)}function ae(e){return!!e&&(e.endsWithParent||ae(e.starts))}class re extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const oe=a,se=r,ce=Symbol("nomatch");var le=function(e){const t=Object.create(null),a=Object.create(null),r=[];let o=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function g(e){return l.noHighlightRe.test(e)}function f(e,n,t){let i="",a="";"object"==typeof n?(i=e,t=n.ignoreIllegals,a=n.language):(Y("10.7.0","highlight(lang, code, ...args) has been deprecated."),Y("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,i=n),void 0===t&&(t=!0);const r={code:i,language:a};O("before:highlight",r);const o=r.result?r.result:y(r.language,r.code,t);return o.code=r.code,O("after:highlight",o),o}function y(e,n,a,r){const c=Object.create(null);function d(){if(!N.keywords)return void A.addText(S);let e=0;N.keywordPatternRe.lastIndex=0;let n=N.keywordPatternRe.exec(S),t="";for(;n;){t+=S.substring(e,n.index);const a=x.case_insensitive?n[0].toLowerCase():n[0],r=(i=a,N.keywords[i]);if(r){const[e,i]=r;if(A.addText(t),t="",c[a]=(c[a]||0)+1,c[a]<=7&&(M+=i),e.startsWith("_"))t+=n[0];else{const t=x.classNameAliases[e]||e;A.addKeyword(n[0],t)}}else t+=n[0];e=N.keywordPatternRe.lastIndex,n=N.keywordPatternRe.exec(S)}var i;t+=S.substring(e),A.addText(t)}function g(){null!=N.subLanguage?function(){if(""===S)return;let e=null;if("string"==typeof N.subLanguage){if(!t[N.subLanguage])return void A.addText(S);e=y(N.subLanguage,S,!0,O[N.subLanguage]),O[N.subLanguage]=e._top}else e=E(S,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(M+=e.relevance),A.addSublanguage(e._emitter,e.language)}():d(),S=""}function u(e,n){let t=1;const i=n.length-1;for(;t<=i;){if(!e._emit[t]){t++;continue}const i=x.classNameAliases[e[t]]||e[t],a=n[t];i?A.addKeyword(a,i):(S=a,d(),S=""),t++}}function b(e,n){return e.scope&&"string"==typeof e.scope&&A.openNode(x.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(A.addKeyword(S,x.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),S=""):e.beginScope._multi&&(u(e.beginScope,n),S="")),N=Object.create(e,{parent:{value:N}}),N}function h(e,n,t){let a=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,t);if(a){if(e["on:end"]){const t=new i(e);e["on:end"](n,t),t.isMatchIgnored&&(a=!1)}if(a){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return h(e.parent,n,t)}function m(e){return 0===N.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function p(e){const t=e[0],i=n.substring(e.index),a=h(N,e,i);if(!a)return ce;const r=N;N.endScope&&N.endScope._wrap?(g(),A.addKeyword(t,N.endScope._wrap)):N.endScope&&N.endScope._multi?(g(),u(N.endScope,e)):r.skip?S+=t:(r.returnEnd||r.excludeEnd||(S+=t),g(),r.excludeEnd&&(S=t));do{N.scope&&A.closeNode(),N.skip||N.subLanguage||(M+=N.relevance),N=N.parent}while(N!==a.parent);return a.starts&&b(a.starts,e),r.returnEnd?0:t.length}let f={};function w(t,r){const s=r&&r[0];if(S+=t,null==s)return g(),0;if("begin"===f.type&&"end"===r.type&&f.index===r.index&&""===s){if(S+=n.slice(r.index,r.index+1),!o){const n=new Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=f.rule,n}return 1}if(f=r,"begin"===r.type)return function(e){const n=e[0],t=e.rule,a=new i(t),r=[t.__beforeBegin,t["on:begin"]];for(const t of r)if(t&&(t(e,a),a.isMatchIgnored))return m(n);return t.skip?S+=n:(t.excludeBegin&&(S+=n),g(),t.returnBegin||t.excludeBegin||(S=n)),b(t,e),t.returnBegin?0:n.length}(r);if("illegal"===r.type&&!a){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(N.scope||"<unnamed>")+'"');throw e.mode=N,e}if("end"===r.type){const e=p(r);if(e!==ce)return e}if("illegal"===r.type&&""===s)return 1;if(T>1e5&&T>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return S+=s,s.length}const x=v(e);if(!x)throw V(s.replace("{}",e)),new Error('Unknown language: "'+e+'"');const _=ie(x);let k="",N=r||_;const O={},A=new l.__emitter(l);!function(){const e=[];for(let n=N;n!==x;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>A.openNode(e)))}();let S="",M=0,R=0,T=0,I=!1;try{for(N.matcher.considerAll();;){T++,I?I=!1:N.matcher.considerAll(),N.matcher.lastIndex=R;const e=N.matcher.exec(n);if(!e)break;const t=w(n.substring(R,e.index),e);R=e.index+t}return w(n.substring(R)),A.closeAllNodes(),A.finalize(),k=A.toHTML(),{language:e,value:k,relevance:M,illegal:!1,_emitter:A,_top:N}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:oe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:R,context:n.slice(R-100,R+100),mode:t.mode,resultSoFar:k},_emitter:A};if(o)return{language:e,value:oe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:N};throw t}}function E(e,n){n=n||l.languages||Object.keys(t);const i=function(e){const n={value:oe(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return n._emitter.addText(e),n}(e),a=n.filter(v).filter(N).map((n=>y(n,e,!1)));a.unshift(i);const r=a.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(v(e.language).supersetOf===n.language)return 1;if(v(n.language).supersetOf===e.language)return-1}return 0})),[o,s]=r,d=o;return d.secondBest=s,d}function w(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=l.languageDetectRe.exec(n);if(t){const n=v(t[1]);return n||(J(s.replace("{}",t[1])),J("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>g(e)||v(e)))}(e);if(g(t))return;if(O("before:highlightElement",{el:e,language:t}),e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),l.throwUnescapedHTML)){throw new re("One of your code blocks includes unescaped HTML.",e.innerHTML)}n=e;const i=n.textContent,r=t?f(i,{language:t,ignoreIllegals:!0}):E(i);e.innerHTML=r.value,function(e,n,t){const i=n&&a[n]||t;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,t,r.language),e.result={language:r.language,re:r.relevance,relevance:r.relevance},r.secondBest&&(e.secondBest={language:r.secondBest.language,relevance:r.secondBest.relevance}),O("after:highlightElement",{el:e,result:r,text:i})}let x=!1;function _(){if("loading"===document.readyState)return void(x=!0);document.querySelectorAll(l.cssSelector).forEach(w)}function v(e){return e=(e||"").toLowerCase(),t[e]||t[a[e]]}function k(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{a[e.toLowerCase()]=n}))}function N(e){const n=v(e);return n&&!n.disableAutodetect}function O(e,n){const t=e;r.forEach((function(e){e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){x&&_()}),!1),Object.assign(e,{highlight:f,highlightAuto:E,highlightAll:_,highlightElement:w,highlightBlock:function(e){return Y("10.7.0","highlightBlock will be removed entirely in v12.0"),Y("10.7.0","Please use highlightElement now."),w(e)},configure:function(e){l=se(l,e)},initHighlighting:()=>{_(),Y("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){_(),Y("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,i){let a=null;try{a=i(e)}catch(e){if(V("Language definition for '{}' could not be registered.".replace("{}",n)),!o)throw e;V(e),a=c}a.name||(a.name=n),t[n]=a,a.rawDefinition=i.bind(null,e),a.aliases&&k(a.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const n of Object.keys(a))a[n]===e&&delete a[n]},listLanguages:function(){return Object.keys(t)},getLanguage:v,registerAliases:k,autoDetection:N,inherit:se,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),r.push(e)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="11.7.0",e.regex={concat:m,lookahead:u,either:p,optional:h,anyNumberOfTimes:b};for(const e in P)"object"==typeof P[e]&&n.exports(P[e]);return Object.assign(e,P),e}({}),de=le;le.HighlightJS=le,le.default=le;var ge=e(de);const ue=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],be=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],he=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],me=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],pe=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();const fe="[A-Za-z$_][0-9A-Za-z$_]*",ye=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Ee=["true","false","null","undefined","NaN","Infinity"],we=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_e=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ve=["arguments","this","super","console","window","document","localStorage","module","global"],ke=[].concat(_e,we,xe);return ge.configure({tabReplace:" ",languages:["abnf","css","http","javascript","json","xml"]}),ge.registerLanguage("abnf",(function(e){const n=e.regex,t=e.COMMENT(/;/,/$/);return{name:"Augmented Backus-Naur Form",illegal:/[!@#$^&',?+~`|:]/,keywords:["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],contains:[{scope:"operator",match:/=\/?/},{scope:"attribute",match:n.concat(/^[a-zA-Z][a-zA-Z0-9-]*/,/(?=\s*=)/)},t,{scope:"symbol",match:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/},{scope:"symbol",match:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/},{scope:"symbol",match:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/},{scope:"symbol",match:/%[si](?=".*")/},e.QUOTE_STRING_MODE,e.NUMBER_MODE]}})),ge.registerLanguage("css",(function(e){const n=e.regex,t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),i=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+he.join("|")+")"},{begin:":(:)?("+me.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pe.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...i,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...i,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:be.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...i,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ue.join("|")+")\\b"}]}})),ge.registerLanguage("http",(function(e){const n="HTTP/(2|1\\.[01])",t={className:"attribute",begin:e.regex.concat("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},i=[t,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+n+" \\d{3})",end:/$/,contains:[{className:"meta",begin:n},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},{begin:"(?=^[A-Z]+ (.*?) "+n+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:n},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},e.inherit(t,{relevance:0})]}})),ge.registerLanguage("javascript",(function(e){const n=e.regex,t=fe,i="<>",a="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,i=e.input[t];if("<"===i||","===i)return void n.ignoreMatch();let a;">"===i&&(((e,{after:n})=>{const t="</"+e[0].slice(1);return-1!==e.input.indexOf(t,n)})(e,{after:t})||n.ignoreMatch());const r=e.input.substring(t);((a=r.match(/^\s*=/))||(a=r.match(/^\s+extends\s+/))&&0===a.index)&&n.ignoreMatch()}},o={$pattern:fe,keyword:ye,literal:Ee,built_in:ke,"variable.language":ve},s="\\.([0-9](_?[0-9])*)",c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={className:"number",variants:[{begin:`(\\b(${c})((${s})|\\.)?|(${s}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{begin:`\\b(${c})\\b((${s})\\b|\\.)?|(${s})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},u={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},b={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},h={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},m=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,u,b,{match:/\$\d+/},l];d.contains=m.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(m)});const p=[].concat(h,d.contains),f=p.concat([{begin:/\(/,end:/\)/,keywords:o,contains:["self"].concat(p)}]),y={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:f},E={variants:[{match:[/class/,/\s+/,t,/\s+/,/extends/,/\s+/,n.concat(t,"(",n.concat(/\./,t),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,t],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...we,...xe]}},x={variants:[{match:[/function/,/\s+/,t,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},_={match:n.concat(/\b/,(v=[..._e,"super","import"],n.concat("(?!",v.join("|"),")")),t,n.lookahead(/\(/)),className:"title.function",relevance:0};var v;const k={begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},N={match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:f,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,u,b,h,{match:/\$\d+/},l,w,{className:"attr",begin:t+n.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[h,e.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:f}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i,end:a},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},x,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:t,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+t,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},_,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},E,N,{match:/\$[(.]/}]}})),ge.registerLanguage("json",(function(e){const n=["true","false","null"],t={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",keywords:{literal:n},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),ge.registerLanguage("xml",(function(e){const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(a,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,s,o,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,r,s,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(t,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:c}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),ge}(); diff --git a/builds/respec-w3c.js b/builds/respec-w3c.js index d441fb34dc..0d0da5aef0 100644 --- a/builds/respec-w3c.js +++ b/builds/respec-w3c.js @@ -1,7 +1,6 @@ -window.respecVersion="33.0.2",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"],M=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function z(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 U extends T{static parse(e){const t={assign:e.consume("=")},n=le(new U({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?z(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 q extends T{static parse(e){const t=e.consumeKind("identifier");if(t)return new q({source:e.source,tokens:{name:t},params:U.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(M.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${M.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=M.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:q.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=q.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 Me={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 ze{constructor(e){this.ts=Object.assign({},Me,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 Ue(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*qe(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:Ue(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[...qe((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=Me}={}){t=Object.assign({},Me,t);const n=new ze(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 M(R="template")?function(e){var t=M(R);return t.innerHTML=e,t.content}:function(e){var t,n=M(S),r=M(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=M(S),n=M("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 M(e){return e===S?C.createDocumentFragment():C.createElementNS("http://www.w3.org/1999/xhtml",e)}var z,U,q,W,F,B,H,G,V,Y=(U="appendChild",q="cloneNode",W="createTextNode",B=(F="importNode")in(z=e),(H=z.createDocumentFragment())[U](z[W]("g")),H[U](z[W]("")),(B?z[F](H,!0):H[q](!0)).childNodes.length<2?function e(t,n){for(var r=t[q](),s=t.childNodes||[],i=s.length,o=0;n&&o<i;o++)r[U](e(s[o],n));return r}:B?z[F]:function(e,t){return e[q](!!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 qe:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ue: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,Me,ze="ownerSVGElement",Ue=v.prototype.nodeType,qe=Ee.prototype.nodeType,We=(Ne=(De={Event:b,WeakSet:u}).Event,Oe=De.WeakSet,je=!0,Me=null,function(e){return je&&(je=!je,Me=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){Me.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)),Me.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=ze 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=ze 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(ze 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,Mt=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)}},zt=It,Ut=We;function qt(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:qt,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=qt(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 qt(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="33.0.3",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"],M=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function z(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 U extends T{static parse(e){const t={assign:e.consume("=")},n=le(new U({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?z(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 q extends T{static parse(e){const t=e.consumeKind("identifier");if(t)return new q({source:e.source,tokens:{name:t},params:U.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(M.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${M.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=M.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:q.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=q.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 Me={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 ze{constructor(e){this.ts=Object.assign({},Me,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 Ue(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*qe(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:Ue(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[...qe((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=Me}={}){t=Object.assign({},Me,t);const n=new ze(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;function Lt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pt,It={exports:{}};Pt=It,function(e,t){Pt.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 Dt=Lt(It.exports),Nt=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 M(R="template")?function(e){var t=M(R);return t.innerHTML=e,t.content}:function(e){var t,n=M(S),r=M(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=M(S),n=M("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 M(e){return e===S?C.createDocumentFragment():C.createElementNS("http://www.w3.org/1999/xhtml",e)}var z,U,q,W,F,B,H,G,V,Y=(U="appendChild",q="cloneNode",W="createTextNode",B=(F="importNode")in(z=e),(H=z.createDocumentFragment())[U](z[W]("g")),H[U](z[W]("")),(B?z[F](H,!0):H[q](!0)).childNodes.length<2?function e(t,n){for(var r=t[q](),s=t.childNodes||[],i=s.length,o=0;n&&o<i;o++)r[U](e(s[o],n));return r}:B?z[F]:function(e,t){return e[q](!!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 qe:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ue: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,Me,ze="ownerSVGElement",Ue=v.prototype.nodeType,qe=Ee.prototype.nodeType,We=(Ne=(De={Event:b,WeakSet:u}).Event,Oe=De.WeakSet,je=!0,Me=null,function(e){return je&&(je=!je,Me=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){Me.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)),Me.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=ze 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=ze 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(ze 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);const Ot=Nt,jt=S,Mt=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)}},Ut=Dt,qt=We;function Wt(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 Ft=Object.freeze({__proto__:null,name:"core/reindent",reindent:Wt,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Wt(e.innerHTML)}});const Bt=/-/g;const Ht=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Gt="en"===c||c.startsWith("en-")?"en-AU":c,Vt=new Intl.DateTimeFormat(Gt,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Gt?"2-digit":"numeric"}),Yt=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function Kt(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 Zt(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Jt(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 Xt=Jt("conjunction"),Qt=Jt("disjunction");function en(e,t){return Xt(e,t).join("")}function tn(e,t){return Qt(e,t).join("")}function nn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}function rn(e){return e.trim().replace(/\s+/g," ")}function sn(e,t=c){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=on(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function on(e,t,n=c){return e[n=n.toLowerCase()]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}function an(e,t=""){return Ht.format(e).replace(Bt,t)}function cn(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){En(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}async function ln(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 un(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Ot`${e}, `));return Ot`${r}${n[n.length-1]}`}function dn(e,t){return[].concat(Xt(e,t)).map((e=>"string"==typeof e?Ot`${e}`:e))}function pn(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)}(rn(e.textContent));return fn(e,t,n)}function fn(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 hn(e){const t=new Set,n="ltNodefault"in e.dataset?"":rn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>rn(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(rn(e))))}return[...t]}function mn(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 gn(e,t){const n=t.closest(Yt);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 bn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function yn(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 wn(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 vn(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 $n 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 kn(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{mn(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),xn(t),t}function xn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[..._n(t)])e.remove()}function*_n(e){for(;e.nextNode();)yield e.currentNode}class Cn 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 Sn 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||fn(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 Rn(e,t,n={}){const s={...n,isWarning:!1};r("error",new Sn(e,t,s))}function En(e,t,n={}){const s={...n,isWarning:!0};r("warn",new Sn(e,t,s))}function An(e){return e?`\`${e}\``:""}function Tn(e,{quotes:t}={quotes:!1}){return tn(e,t?e=>An(Pn(e)):An)}function Ln(e,{quotes:t}={quotes:!1}){return en(e,t?e=>An(Pn(e)):An)}function Pn(e){return String(e)?`"${e}"`:""}function In(e,...t){return Wt(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 Dn=new Map([["text/html","html"],["application/xml","xml"]]);function Nn(e,t=document){const n=Dn.get(e);if(!n){const t=[...Dn.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=On(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function On(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:s}=e;xn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Zt(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=Ot`<meta charset="utf-8" />`);i.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Ot` <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 Mn="core/pre-process";const zn="core/base-runner";async function Un(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(`${zn}-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.",Mn),t})).map((async t=>{try{return await t(e,document)}catch(e){Sn(`Function ${t.name} threw an error during \`preProcess\`.`,Mn,{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(`${zn}-end`),performance.measure(zn,`${zn}-start`,`${zn}-end`)}var qn=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} + `;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:Nn});class jn{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 On("html",document)}}const Mn="core/post-process";const zn="core/pre-process";const Un="core/base-runner";async function qn(e){!function(){const e=new jn;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(`${Un}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Rn("Every item in `preProcess` must be a JS function.",zn),t})).map((async t=>{try{return await t(e,document)}catch(e){Rn(`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||Rn("Every item in `postProcess` must be a JS function.",Mn),t})).map((async t=>{try{return await t(e,document)}catch(e){Rn(`Function ${t.name} threw an error during \`postProcess\`.`,Mn,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Zt(document),performance.mark(`${Un}-end`),performance.measure(Un,`${Un}-start`,`${Un}-end`)}var Wn=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,42 +64,42 @@ 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 Wn=/>/gm,Fn=/&/gm;class Bn extends jt.Renderer{code(e,t,n){const{language:r,...s}=Bn.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const i=super.code(e,r,n),{example:o,illegalExample:a}=s;if(!o&&!a)return i;const c=o||a,l=`${r} ${o?"example":"illegal-example"}`;return i.replace("<pre>",`<pre title="${c}" class="${l}">`)}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 Fn=/>/gm,Bn=/&/gm;class Hn extends Mt.Renderer{code(e,t,n){const{language:r,...s}=Hn.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const i=super.code(e,r,n),{example:o,illegalExample:a}=s;if(!o&&!a)return i;const c=o||a,l=`${r} ${o?"example":"illegal-example"}`;return i.replace("<pre>",`<pre title="${c}" class="${l}">`)}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 s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n,r){const s=/(.+)\s+{#([\w-]+)}$/;if(s.test(e)){const[,n,r]=e.match(s);return`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}const Hn={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new Bn};function Gn(e,t={inline:!1}){const n=qt(e).replace(Wn,">").replace(Fn,"&");return t.inline?jt.parseInline(n,Hn):jt.parse(n,Hn)}function Vn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Gn(e.innerHTML)}const Yn=(Kn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Kn);return t.forEach(Vn),Array.from(t)});var Kn;var Zn=Object.freeze({__proto__:null,markdownToHtml:Gn,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 Yn(document.body);const r=document.getElementById("respec-ui");r.remove();const s=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"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=wn(e);e.append(`\n\n${t}`)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Vn(s),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(s.querySelectorAll(".nolinks a[href]")),s.append(r),document.body.replaceWith(s)}});function Jn(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=qn,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Xn=Nt`<div id="respec-ui" class="removeOnSave" hidden></div>`,Qn=Nt`<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 s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n,r){const s=/(.+)\s+{#([\w-]+)}$/;if(s.test(e)){const[,n,r]=e.match(s);return`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}const Gn={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new Hn};function Vn(e,t={inline:!1}){const n=Wt(e).replace(Fn,">").replace(Bn,"&");return t.inline?Mt.parseInline(n,Gn):Mt.parse(n,Gn)}function Yn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Vn(e.innerHTML)}const Kn=(Zn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Zn);return t.forEach(Yn),Array.from(t)});var Zn;var Jn=Object.freeze({__proto__:null,markdownToHtml:Vn,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 Kn(document.body);const r=document.getElementById("respec-ui");r.remove();const s=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"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=vn(e);e.append(`\n\n${t}`)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Yn(s),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(s.querySelectorAll(".nolinks a[href]")),s.append(r),document.body.replaceWith(s)}});function Xn(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=Wn,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Qn=Ot`<div id="respec-ui" class="removeOnSave" hidden></div>`,er=Ot`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" hidden -></ul>`,er=Nt`<button +></ul>`,tr=Ot`<button class="close-button" - onclick=${()=>dr.closeModal()} + onclick=${()=>pr.closeModal()} title="Close" > ❌ -</button>`;let tr,nr;window.addEventListener("load",(()=>cr(Qn)));const rr=[],sr=[],ir={};s("start-all",(()=>document.body.prepend(Xn)),{once:!0}),s("end-all",(()=>document.body.prepend(Xn)),{once:!0});const or=Nt`<button id="respec-pill" disabled>ReSpec</button>`;function ar(){Qn.classList.toggle("respec-hidden"),Qn.classList.toggle("respec-visible"),Qn.hidden=!Qn.hidden}function cr(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()))}))}Xn.appendChild(or),or.addEventListener("click",(e=>{e.stopPropagation(),or.setAttribute("aria-expanded",String(Qn.hidden)),ar(),Qn.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{Qn.hidden||ar()})),Xn.appendChild(Qn),Qn.addEventListener("keydown",(e=>{"Escape"!==e.key||Qn.hidden||(or.setAttribute("aria-expanded",String(Qn.hidden)),ar(),or.focus())}));const lr=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function ur(e,t,n,r){t.push(e),ir.hasOwnProperty(n)||(ir[n]=function(e,t,n){const r=Nt`<button +</button>`;let nr,rr;window.addEventListener("load",(()=>lr(er)));const sr=[],ir=[],or={};s("start-all",(()=>document.body.prepend(Qn)),{once:!0}),s("end-all",(()=>document.body.prepend(Qn)),{once:!0});const ar=Ot`<button id="respec-pill" disabled>ReSpec</button>`;function cr(){er.classList.toggle("respec-hidden"),er.classList.toggle("respec-visible"),er.hidden=!er.hidden}function lr(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()))}))}Qn.appendChild(ar),ar.addEventListener("click",(e=>{e.stopPropagation(),ar.setAttribute("aria-expanded",String(er.hidden)),cr(),er.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{er.hidden||cr()})),Qn.appendChild(er),er.addEventListener("keydown",(e=>{"Escape"!==e.key||er.hidden||(ar.setAttribute("aria-expanded",String(er.hidden)),cr(),ar.focus())}));const ur=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function dr(e,t,n,r){t.push(e),or.hasOwnProperty(n)||(or[n]=function(e,t,n){const r=Ot`<button id="${`respec-pill-${e}`}" class="respec-info-button" - ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const s=Nt`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(pr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),s.appendChild(n)}dr.freshModal(n,s,r)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Jn(r,s),r}(n,t,r),Xn.appendChild(ir[n]));const s=ir[n];s.textContent=t.length;const i=1===t.length?zt.singular(r):r;Jn(s,new Map([["label",`${t.length} ${i}`]]))}Jn(or,lr);const dr={show(){try{Xn.hidden=!1}catch(e){console.error(e)}},hide(){Xn.hidden=!0},enable(){or.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=Nt`<button id="${s}" class="respec-option"> + ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const s=Ot`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(fr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),s.appendChild(n)}pr.freshModal(n,s,r)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Xn(r,s),r}(n,t,r),Qn.appendChild(or[n]));const s=or[n];s.textContent=t.length;const i=1===t.length?Ut.singular(r):r;Xn(s,new Map([["label",`${t.length} ${i}`]]))}Xn(ar,ur);const pr={show(){try{Qn.hidden=!1}catch(e){console.error(e)}},hide(){Qn.hidden=!0},enable(){ar.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=Ot`<button id="${s}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}… - </button>`,o=Nt`<li role="menuitem">${i}</li>`;return o.addEventListener("click",t),Qn.appendChild(o),i},error(e){ur(e,rr,"error","ReSpec Errors")},warning(e){ur(e,sr,"warning","ReSpec Warnings")},closeModal(e){nr&&(nr.classList.remove("respec-show-overlay"),nr.classList.add("respec-hide-overlay"),nr.addEventListener("transitionend",(()=>{nr.remove(),nr=null}))),e&&e.setAttribute("aria-expanded","false"),tr&&(tr.remove(),tr=null,or.focus())},freshModal(e,t,n){tr&&tr.remove(),nr&&nr.remove(),nr=Nt`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,s=`${r}-heading`;tr=Nt`<div + </button>`,o=Ot`<li role="menuitem">${i}</li>`;return o.addEventListener("click",t),er.appendChild(o),i},error(e){dr(e,sr,"error","ReSpec Errors")},warning(e){dr(e,ir,"warning","ReSpec Warnings")},closeModal(e){rr&&(rr.classList.remove("respec-show-overlay"),rr.classList.add("respec-hide-overlay"),rr.addEventListener("transitionend",(()=>{rr.remove(),rr=null}))),e&&e.setAttribute("aria-expanded","false"),nr&&(nr.remove(),nr=null,ar.focus())},freshModal(e,t,n){nr&&nr.remove(),rr&&rr.remove(),rr=Ot`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,s=`${r}-heading`;nr=Ot`<div id="${r}" class="respec-modal removeOnSave" role="dialog" aria-labelledby="${s}" > - ${er} + ${tr} <h3 id="${s}">${e}</h3> <div class="inside">${t}</div> - </div>`;const i=new Map([["labelledby",s]]);Jn(tr,i),document.body.append(nr,tr),nr.addEventListener("click",(()=>this.closeModal(n))),nr.classList.toggle("respec-show-overlay"),tr.hidden=!1,cr(tr)}};function pr(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Gn(`<p class="respec-hint"><strong>How to fix:</strong> ${qt(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 ${Gn(e.elements.map(fr).join("\n"))}`:"",s=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${Gn(`**${e.message}**`,{inline:!0})}${n}${r}${s}${t}`}function fr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function hr(e){try{dr.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Un(e)}finally{dr.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&dr.closeModal()})),window.respecUI=dr,s("error",(e=>dr.error(e))),s("warn",(e=>dr.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const mr=[Promise.resolve().then((function(){return gr})),Promise.resolve().then((function(){return l})),Promise.resolve().then((function(){return wr})),Promise.resolve().then((function(){return us})),Promise.resolve().then((function(){return fs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return ks})),Promise.resolve().then((function(){return Ts})),Promise.resolve().then((function(){return Zn})),Promise.resolve().then((function(){return Wt})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Os})),Promise.resolve().then((function(){return ss})),Promise.resolve().then((function(){return zs})),Promise.resolve().then((function(){return Us})),Promise.resolve().then((function(){return Fs})),Promise.resolve().then((function(){return Xi})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return fo})),Promise.resolve().then((function(){return ho})),Promise.resolve().then((function(){return yo})),Promise.resolve().then((function(){return xo})),Promise.resolve().then((function(){return Eo})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return Io})),Promise.resolve().then((function(){return ta})),Promise.resolve().then((function(){return wi})),Promise.resolve().then((function(){return $a})),Promise.resolve().then((function(){return Oa})),Promise.resolve().then((function(){return da})),Promise.resolve().then((function(){return Ti})),Promise.resolve().then((function(){return Ka})),Promise.resolve().then((function(){return Ja})),Promise.resolve().then((function(){return Ss})),Promise.resolve().then((function(){return Xa})),Promise.resolve().then((function(){return Qa})),Promise.resolve().then((function(){return ac})),Promise.resolve().then((function(){return lc})),Promise.resolve().then((function(){return dc})),Promise.resolve().then((function(){return bc})),Promise.resolve().then((function(){return Cc})),Promise.resolve().then((function(){return Ac})),Promise.resolve().then((function(){return Ic})),Promise.resolve().then((function(){return jc})),Promise.resolve().then((function(){return Fc})),Promise.resolve().then((function(){return Bc})),Promise.resolve().then((function(){return Zc})),Promise.resolve().then((function(){return rl})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return ul})),Promise.resolve().then((function(){return ml})),Promise.resolve().then((function(){return $l})),Promise.resolve().then((function(){return xl})),Promise.resolve().then((function(){return Cl})),Promise.resolve().then((function(){return Il})),Promise.resolve().then((function(){return Ol})),Promise.resolve().then((function(){return ql})),Promise.resolve().then((function(){return Wl})),Promise.resolve().then((function(){return Bl})),Promise.resolve().then((function(){return Vl})),Promise.resolve().then((function(){return Jl})),Promise.resolve().then((function(){return eu})),Promise.resolve().then((function(){return su})),Promise.resolve().then((function(){return au})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return mu})),Promise.resolve().then((function(){return yu})),Promise.resolve().then((function(){return _u})),Promise.resolve().then((function(){return Ru})),Promise.resolve().then((function(){return Tu})),Promise.resolve().then((function(){return Du})),Promise.resolve().then((function(){return Mu}))];Promise.all(mr).then((e=>hr(e))).catch((e=>console.error(e)));var gr=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 br="w3c/group";async function yr(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,"https://respec.org/w3c/groups/"),s=await cn(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,patentURI:r,patentPolicy:i,type:o,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:i,groupType:o}}const i=await s.text();let o,a=`Failed to fetch group details (HTTP: ${s.status}).`;409===s.status?[a,o]=i.split("\n",2):404===s.status&&(o=Pn`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),Sn(a,br,{hint:o})}var wr=Object.freeze({__proto__:null,name:br,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(yr)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter((e=>e)))for(const t of Object.keys(n))n[t].push(e[t]);return n}(t):await yr(t);Object.assign(e,n)}});function vr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Rn(t,"core/templates/show-link"),void console.warn(t,e)}return Nt` + </div>`;const i=new Map([["labelledby",s]]);Xn(nr,i),document.body.append(rr,nr),rr.addEventListener("click",(()=>this.closeModal(n))),rr.classList.toggle("respec-show-overlay"),nr.hidden=!1,lr(nr)}};function fr(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Vn(`<p class="respec-hint"><strong>How to fix:</strong> ${Wt(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 ${Vn(e.elements.map(hr).join("\n"))}`:"",s=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${Vn(`**${e.message}**`,{inline:!0})}${n}${r}${s}${t}`}function hr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function mr(e){try{pr.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await qn(e)}finally{pr.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&pr.closeModal()})),window.respecUI=pr,s("error",(e=>pr.error(e))),s("warn",(e=>pr.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const gr=[Promise.resolve().then((function(){return br})),Promise.resolve().then((function(){return l})),Promise.resolve().then((function(){return vr})),Promise.resolve().then((function(){return ps})),Promise.resolve().then((function(){return ms})),Promise.resolve().then((function(){return ys})),Promise.resolve().then((function(){return _s})),Promise.resolve().then((function(){return Ps})),Promise.resolve().then((function(){return Jn})),Promise.resolve().then((function(){return Ft})),Promise.resolve().then((function(){return Ns})),Promise.resolve().then((function(){return Ms})),Promise.resolve().then((function(){return os})),Promise.resolve().then((function(){return qs})),Promise.resolve().then((function(){return Ws})),Promise.resolve().then((function(){return Hs})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return ro})),Promise.resolve().then((function(){return mo})),Promise.resolve().then((function(){return go})),Promise.resolve().then((function(){return vo})),Promise.resolve().then((function(){return Co})),Promise.resolve().then((function(){return To})),Promise.resolve().then((function(){return Io})),Promise.resolve().then((function(){return No})),Promise.resolve().then((function(){return ra})),Promise.resolve().then((function(){return $i})),Promise.resolve().then((function(){return xa})),Promise.resolve().then((function(){return Ma})),Promise.resolve().then((function(){return fa})),Promise.resolve().then((function(){return Pi})),Promise.resolve().then((function(){return Ja})),Promise.resolve().then((function(){return Qa})),Promise.resolve().then((function(){return Es})),Promise.resolve().then((function(){return ec})),Promise.resolve().then((function(){return tc})),Promise.resolve().then((function(){return lc})),Promise.resolve().then((function(){return dc})),Promise.resolve().then((function(){return fc})),Promise.resolve().then((function(){return wc})),Promise.resolve().then((function(){return Rc})),Promise.resolve().then((function(){return Lc})),Promise.resolve().then((function(){return Nc})),Promise.resolve().then((function(){return zc})),Promise.resolve().then((function(){return Hc})),Promise.resolve().then((function(){return Gc})),Promise.resolve().then((function(){return Xc})),Promise.resolve().then((function(){return il})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return pl})),Promise.resolve().then((function(){return bl})),Promise.resolve().then((function(){return xl})),Promise.resolve().then((function(){return Cl})),Promise.resolve().then((function(){return Rl})),Promise.resolve().then((function(){return Nl})),Promise.resolve().then((function(){return Ml})),Promise.resolve().then((function(){return Fl})),Promise.resolve().then((function(){return Bl})),Promise.resolve().then((function(){return Gl})),Promise.resolve().then((function(){return Kl})),Promise.resolve().then((function(){return Ql})),Promise.resolve().then((function(){return nu})),Promise.resolve().then((function(){return ou})),Promise.resolve().then((function(){return lu})),Promise.resolve().then((function(){return hu})),Promise.resolve().then((function(){return bu})),Promise.resolve().then((function(){return vu})),Promise.resolve().then((function(){return Su})),Promise.resolve().then((function(){return Au})),Promise.resolve().then((function(){return Pu})),Promise.resolve().then((function(){return Ou})),Promise.resolve().then((function(){return Uu}))];Promise.all(gr).then((e=>mr(e))).catch((e=>console.error(e)));var br=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 yr="w3c/group";async function wr(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,"https://respec.org/w3c/groups/"),s=await ln(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,patentURI:r,patentPolicy:i,type:o,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:i,groupType:o}}const i=await s.text();let o,a=`Failed to fetch group details (HTTP: ${s.status}).`;409===s.status?[a,o]=i.split("\n",2):404===s.status&&(o=In`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),Rn(a,yr,{hint:o})}var vr=Object.freeze({__proto__:null,name:yr,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(wr)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter((e=>e)))for(const t of Object.keys(n))n[t].push(e[t]);return n}(t):await wr(t);Object.assign(e,n)}});function $r(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return En(t,"core/templates/show-link"),void console.warn(t,e)}return Ot` <dt class="${e.class?e.class:null}">${e.key}</dt> - ${e.data?e.data.map($r):$r(e)} - `}function $r(e){return Nt`<dd class="${e.class?e.class:null}"> - ${e.href?Nt`<a href="${e.href}">${e.value||e.href}</a>`:e.value} - </dd>`}const kr="core/templates/show-logo";function xr(e,t){const n=Nt`<a href="${e.url||null}" class="logo" + ${e.data?e.data.map(kr):kr(e)} + `}function kr(e){return Ot`<dd class="${e.class?e.class:null}"> + ${e.href?Ot`<a href="${e.href}">${e.value||e.href}</a>`:e.value} + </dd>`}const xr="core/templates/show-logo";function _r(e,t){const n=Ot`<a href="${e.url||null}" class="logo" ><img alt="${e.alt||null}" crossorigin @@ -109,7 +108,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} src="${e.src||null}" width="${e.width||null}" /> - </a>`;if(!e.alt){const r=Pn`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Sn(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,kr,{hint:r,elements:[n]})}if(!e.src){const e=Pn`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Sn(`Logo at index ${t} is missing "\`src\`" property.`,kr,{hint:e,elements:[n]})}return n}const _r="core/templates/show-people",Cr=rn({en:{until:e=>Nt` Until ${e} `},es:{until:e=>Nt` Hasta ${e} `},ko:{until:e=>Nt` ${e} 이전 `},ja:{until:e=>Nt` ${e} 以前 `},de:{until:e=>Nt` bis ${e} `},zh:{until:e=>Nt` 直到 ${e} `}});function Sr(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(s=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 "[\`${s}\`](${n}#${s})" configuration option.`;if(!e.name)return Sn(`${i} Missing required property \`"name"\`.`,_r,{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.`,s=`The origin should be "https://orcid.org", not "${r.origin}".`;return Sn(n,_r,{hint:s}),!1}const s=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(s))return Sn(`${i} ORCID "${s}" has wrong format.`,_r,{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 Sn(`${i} ORCID "${n}" failed checksum check.`,_r,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(o=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(o)?new Date(o):"Invalid Date").toString())?(Sn(`${i} The property "\`retiredDate\`" is not a valid date.`,_r,{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 Sn(`${n}. Member "extra" at index ${r} is not an object.`,_r,{hint:t}),!1;case!e.hasOwnProperty("name"):return Sn(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,_r,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Sn(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,_r,{hint:t}),!1}return!0})):(Sn(`${n}. A person's "extras" member must be an array.`,_r,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&Rn(`${i} Has both "url" and "mailto" property.`,_r,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&Rn(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,_r,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var o});var s;return n.filter(r).map(Rr)}function Rr(e){const t=[e.name],n=[e.company],r=e.w3cid||null,s=[];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";s.push(Nt`<a class="${n}" href="${e.url}">${t}</a>`)}else s.push(Nt`<span class="p-name fn">${t}</span>`);if(e.orcid&&s.push(Nt`<a class="p-name orcid" href="${e.orcid}">${Nt`<svg + </a>`;if(!e.alt){const r=In`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Rn(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,xr,{hint:r,elements:[n]})}if(!e.src){const e=In`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Rn(`Logo at index ${t} is missing "\`src\`" property.`,xr,{hint:e,elements:[n]})}return n}const Cr="core/templates/show-people",Sr=sn({en:{until:e=>Ot` Until ${e} `},es:{until:e=>Ot` Hasta ${e} `},ko:{until:e=>Ot` ${e} 이전 `},ja:{until:e=>Ot` ${e} 以前 `},de:{until:e=>Ot` bis ${e} `},zh:{until:e=>Ot` 直到 ${e} `}});function Rr(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(s=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 "[\`${s}\`](${n}#${s})" configuration option.`;if(!e.name)return Rn(`${i} Missing required property \`"name"\`.`,Cr,{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.`,s=`The origin should be "https://orcid.org", not "${r.origin}".`;return Rn(n,Cr,{hint:s}),!1}const s=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(s))return Rn(`${i} ORCID "${s}" has wrong format.`,Cr,{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 Rn(`${i} ORCID "${n}" failed checksum check.`,Cr,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(o=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(o)?new Date(o):"Invalid Date").toString())?(Rn(`${i} The property "\`retiredDate\`" is not a valid date.`,Cr,{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 Rn(`${n}. Member "extra" at index ${r} is not an object.`,Cr,{hint:t}),!1;case!e.hasOwnProperty("name"):return Rn(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Cr,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Rn(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Cr,{hint:t}),!1}return!0})):(Rn(`${n}. A person's "extras" member must be an array.`,Cr,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&En(`${i} Has both "url" and "mailto" property.`,Cr,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&En(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,Cr,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var o});var s;return n.filter(r).map(Er)}function Er(e){const t=[e.name],n=[e.company],r=e.w3cid||null,s=[];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";s.push(Ot`<a class="${n}" href="${e.url}">${t}</a>`)}else s.push(Ot`<span class="p-name fn">${t}</span>`);if(e.orcid&&s.push(Ot`<a class="p-name orcid" href="${e.orcid}">${Ot`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" @@ -128,104 +127,104 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} 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?Nt`<a class="${t}" href="${e.companyURL}">${n}</a>`:Nt`<span class="${t}">${n}</span>`;s.push(Nt` (${r})`)}e.note&&s.push(document.createTextNode(` (${e.note})`)),e.extras&&s.push(...e.extras.map((e=>Nt`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?Nt`<a href="${r}" class="${t}">${n}</a>`:Nt`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:i}=e;if(e.retiredDate){const e=Nt`<time datetime="${i}" - >${Gt.format(new Date(i))}</time - >`;s.push(Nt` - ${Cr.until(e)} `)}return Nt`<dd +</svg>`}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?Ot`<a class="${t}" href="${e.companyURL}">${n}</a>`:Ot`<span class="${t}">${n}</span>`;s.push(Ot` (${r})`)}e.note&&s.push(document.createTextNode(` (${e.note})`)),e.extras&&s.push(...e.extras.map((e=>Ot`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?Ot`<a href="${r}" class="${t}">${n}</a>`:Ot`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:i}=e;if(e.retiredDate){const e=Ot`<time datetime="${i}" + >${Vt.format(new Date(i))}</time + >`;s.push(Ot` - ${Sr.until(e)} `)}return Ot`<dd class="editor p-author h-card vcard" data-editor-id="${r}" > ${s} - </dd>`}const Er=rn({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"… message topic …",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",commit_history:"Git提交历史",editor:"编辑:",editors:"编辑:",feedback:"反馈:",former_editor:"原编辑:",former_editors:"原编辑:",history:"历史:",implementation_report:"实现报告:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",latest_recommendation:"最新发布的正式推荐标准:",message_topic:"… 邮件主题 …",prev_editor_draft:"上一版编辑草稿:",prev_recommendation:"上一版正式推荐标准:",prev_version:"上一版:",test_suite:"测试套件:",this_version:"本版本:"},ja:{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:"この文書についてのより詳細",prev_editor_draft:"前回の編集用草案:",prev_recommendation:"前回の勧告版:",prev_version:"前回のバージョン:",publication_history:"公表履歴",test_suite:"テストスイート:",this_version:"このバージョン:",with_subject_line:"次の件名で"},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:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementación:",latest_editors_draft:"Última versión del editor:",latest_published_version:"Última versión publicada:",latest_recommendation:"Recomendación más reciente:",message_topic:"… detalles de mensaje …",more_details_about_this_doc:"Más detalles sobre este documento:",publication_history:"Historial de publicación",prev_editor_draft:"Última versión del editor:",prev_recommendation:"Última Recomendación:",prev_version:"Última versión:",test_suite:"Suite de pruebas:",this_version:"Esta versión:",with_subject_line:"con línea de asunto",your_topic_here:"TU SUJETO AQUÍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geändert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen über dieses Dokument",multiple_alternates:e=>`Dieses Dokument ist ebenfalls in ${e?"diesen nicht-normativen Formaten verfügbar":"diesem nicht-normativen Format verfügbar"}:`,prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Veröffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"}});function Ar(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}var Tr=(e,t)=>(s("beforesave",(e=>{e.querySelector(".head details").open=!0})),Nt`<div class="head"> - ${e.logos.length?Nt`<p class="logos">${e.logos.map(xr)}</p>`:""} - ${document.querySelector("h1#title")} ${Ar(e)} - <p id="w3c-state">${function(e){const t=e.isCR||e.isCRY?e.longStatus:e.textStatus,n=e.prependW3C?Nt`<a href="https://www.w3.org/standards/types#${e.specStatus}" + </dd>`}const Ar=sn({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"… message topic …",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",commit_history:"Git提交历史",editor:"编辑:",editors:"编辑:",feedback:"反馈:",former_editor:"原编辑:",former_editors:"原编辑:",history:"历史:",implementation_report:"实现报告:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",latest_recommendation:"最新发布的正式推荐标准:",message_topic:"… 邮件主题 …",prev_editor_draft:"上一版编辑草稿:",prev_recommendation:"上一版正式推荐标准:",prev_version:"上一版:",test_suite:"测试套件:",this_version:"本版本:"},ja:{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:"この文書についてのより詳細",prev_editor_draft:"前回の編集用草案:",prev_recommendation:"前回の勧告版:",prev_version:"前回のバージョン:",publication_history:"公表履歴",test_suite:"テストスイート:",this_version:"このバージョン:",with_subject_line:"次の件名で"},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:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementación:",latest_editors_draft:"Última versión del editor:",latest_published_version:"Última versión publicada:",latest_recommendation:"Recomendación más reciente:",message_topic:"… detalles de mensaje …",more_details_about_this_doc:"Más detalles sobre este documento:",publication_history:"Historial de publicación",prev_editor_draft:"Última versión del editor:",prev_recommendation:"Última Recomendación:",prev_version:"Última versión:",test_suite:"Suite de pruebas:",this_version:"Esta versión:",with_subject_line:"con línea de asunto",your_topic_here:"TU SUJETO AQUÍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geändert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen über dieses Dokument",multiple_alternates:e=>`Dieses Dokument ist ebenfalls in ${e?"diesen nicht-normativen Formaten verfügbar":"diesem nicht-normativen Format verfügbar"}:`,prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Veröffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"}});function Tr(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}var Lr=(e,t)=>(s("beforesave",(e=>{e.querySelector(".head details").open=!0})),Ot`<div class="head"> + ${e.logos.length?Ot`<p class="logos">${e.logos.map(_r)}</p>`:""} + ${document.querySelector("h1#title")} ${Tr(e)} + <p id="w3c-state">${function(e){const t=e.isCR||e.isCRY?e.longStatus:e.textStatus,n=e.prependW3C?Ot`<a href="https://www.w3.org/standards/types#${e.specStatus}" >W3C ${t}</a - >`:Nt`${t}`;return Nt`${n}${" "} + >`:Ot`${t}`;return Ot`${n}${" "} <time class="dt-published" datetime="${e.dashDate}" - >${Gt.format(e.publishDate)}</time - >${e.modificationDate?Nt`, ${Er.edited_in_place}${" "} + >${Vt.format(e.publishDate)}</time + >${e.modificationDate?Ot`, ${Ar.edited_in_place}${" "} <time class="dt-modified" - datetime="${Bt.format(e.modificationDate)}" - >${Gt.format(e.modificationDate)}</time + datetime="${Ht.format(e.modificationDate)}" + >${Vt.format(e.modificationDate)}</time >`:""}`}(e)}</p> <details open="${localStorage.getItem("tr-metadata")||"true"}"> - <summary>${Er.more_details_about_this_doc}</summary> + <summary>${Ar.more_details_about_this_doc}</summary> <dl> - ${e.thisVersion?Nt`<dt>${Er.this_version}</dt> + ${e.thisVersion?Ot`<dt>${Ar.this_version}</dt> <dd> <a class="u-url" href="${e.thisVersion}" >${e.thisVersion}</a > </dd>`:""} - ${"latestVersion"in e?Nt`<dt>${Er.latest_published_version}</dt> + ${"latestVersion"in e?Ot`<dt>${Ar.latest_published_version}</dt> <dd> - ${e.latestVersion?Nt`<a href="${e.latestVersion}" + ${e.latestVersion?Ot`<a href="${e.latestVersion}" >${e.latestVersion}</a >`:"none"} </dd>`:""} - ${e.edDraftURI?Nt` - <dt>${Er.latest_editors_draft}</dt> + ${e.edDraftURI?Ot` + <dt>${Ar.latest_editors_draft}</dt> <dd><a href="${e.edDraftURI}">${e.edDraftURI}</a></dd> `:""} - ${e.historyURI||e.github?Nt`<dt>${Er.history}</dt> - ${e.historyURI?Nt`<dd> + ${e.historyURI||e.github?Ot`<dt>${Ar.history}</dt> + ${e.historyURI?Ot`<dd> <a href="${e.historyURI}">${e.historyURI}</a> </dd>`:""} - ${e.github?Nt`<dd> + ${e.github?Ot`<dd> <a href="${e.github.commitHistoryURL}" - >${Er.commit_history}</a + >${Ar.commit_history}</a > </dd>`:""}`:""} - ${e.testSuiteURI?Nt` - <dt>${Er.test_suite}</dt> + ${e.testSuiteURI?Ot` + <dt>${Ar.test_suite}</dt> <dd><a href="${e.testSuiteURI}">${e.testSuiteURI}</a></dd> `:""} - ${e.implementationReportURI?Nt` - <dt>${Er.implementation_report}</dt> + ${e.implementationReportURI?Ot` + <dt>${Ar.implementation_report}</dt> <dd> <a href="${e.implementationReportURI}" >${e.implementationReportURI}</a > </dd> `:""} - ${e.prevED?Nt` - <dt>${Er.prev_editor_draft}</dt> + ${e.prevED?Ot` + <dt>${Ar.prev_editor_draft}</dt> <dd><a href="${e.prevED}">${e.prevED}</a></dd> `:""} - ${e.showPreviousVersion?Nt` - <dt>${Er.prev_version}</dt> + ${e.showPreviousVersion?Ot` + <dt>${Ar.prev_version}</dt> <dd><a href="${e.prevVersion}">${e.prevVersion}</a></dd> `:""} - ${e.prevRecURI?e.isRec?Nt` - <dt>${Er.prev_recommendation}</dt> + ${e.prevRecURI?e.isRec?Ot` + <dt>${Ar.prev_recommendation}</dt> <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd> - `:Nt` - <dt>${Er.latest_recommendation}</dt> + `:Ot` + <dt>${Ar.latest_recommendation}</dt> <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd> `:""} - ${e.editors.length?Nt` - <dt>${e.editors.length>1?Er.editors:Er.editor}</dt> - ${Sr(e,"editors")} + ${e.editors.length?Ot` + <dt>${e.editors.length>1?Ar.editors:Ar.editor}</dt> + ${Rr(e,"editors")} `:""} - ${e.formerEditors.length?Nt` + ${e.formerEditors.length?Ot` <dt> - ${e.formerEditors.length>1?Er.former_editors:Er.former_editor} + ${e.formerEditors.length>1?Ar.former_editors:Ar.former_editor} </dt> - ${Sr(e,"formerEditors")} + ${Rr(e,"formerEditors")} `:""} - ${e.authors.length?Nt` - <dt>${e.authors.length>1?Er.authors:Er.author}</dt> - ${Sr(e,"authors")} + ${e.authors.length?Ot` + <dt>${e.authors.length>1?Ar.authors:Ar.author}</dt> + ${Rr(e,"authors")} `:""} - ${e.github||e.wgPublicList?Nt`<dt>${Er.feedback}</dt> - ${Lr(e)}`:""} - ${e.errata?Nt`<dt>Errata:</dt> + ${e.github||e.wgPublicList?Ot`<dt>${Ar.feedback}</dt> + ${Pr(e)}`:""} + ${e.errata?Ot`<dt>Errata:</dt> <dd><a href="${e.errata}">Errata exists</a>.</dd>`:""} - ${e.otherLinks?e.otherLinks.map(vr):""} + ${e.otherLinks?e.otherLinks.map($r):""} </dl> </details> - ${e.isRec?Nt`<p> + ${e.isRec?Ot`<p> See also <a href="${`https://www.w3.org/Translations/?technology=${e.shortName}`}" @@ -233,25 +232,25 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} <strong>translations</strong></a >. </p>`:""} - ${e.alternateFormats?Nt`<p> - ${Er.multiple_alternates(t.multipleAlternates)} + ${e.alternateFormats?Ot`<p> + ${Ar.multiple_alternates(t.multipleAlternates)} ${t.alternatesHTML} </p>`:""} - ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.isUnofficial&&e.licenseInfo)return Nt`<p class="copyright"> + ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.isUnofficial&&e.licenseInfo)return Ot`<p class="copyright"> Copyright © ${e.copyrightStart?`${e.copyrightStart}-`:""}${e.publishYear} the document editors/authors. - ${"unlicensed"!==e.licenseInfo.name?Nt`Text is available under the + ${"unlicensed"!==e.licenseInfo.name?Ot`Text is available under the <a rel="license" href="${e.licenseInfo.url}" >${e.licenseInfo.name}</a >; additional terms may apply.`:""} - </p>`;return function(e){return Nt`<p class="copyright"> + </p>`;return function(e){return Ot`<p class="copyright"> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright" >Copyright</a > © ${e.copyrightStart?`${e.copyrightStart}-`:""}${e.publishYear} - ${e.additionalCopyrightHolders?Nt` ${[e.additionalCopyrightHolders]} & `:""} + ${e.additionalCopyrightHolders?Ot` ${[e.additionalCopyrightHolders]} & `:""} <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer" @@ -259,54 +258,54 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks" >trademark</a - >${function(e){const{url:t,short:n,name:r}=e;if("unlicensed"===r)return Nt`. <span class="issue">THIS DOCUMENT IS UNLICENSED</span>.`;return Nt` and + >${function(e){const{url:t,short:n,name:r}=e;if("unlicensed"===r)return Ot`. <span class="issue">THIS DOCUMENT IS UNLICENSED</span>.`;return Ot` and <a rel="license" href="${t}" title="${r}">${n}</a> rules apply.`}(e.licenseInfo)} </p>`}(e)}(e)} <hr title="Separator for header" /> - </div>`);function Lr(e){const t=[];if(e.github){const{repoURL:n,issuesURL:r,newIssuesURL:s,pullsURL:i,fullName:o}=e.github;t.push(Nt`<dd> + </div>`);function Pr(e){const t=[];if(e.github){const{repoURL:n,issuesURL:r,newIssuesURL:s,pullsURL:i,fullName:o}=e.github;t.push(Ot`<dd> <a href="${n}">GitHub ${o}</a> (<a href="${i}">pull requests</a>, <a href="${s}">new issue</a>, <a href="${r}">open issues</a>) - </dd>`)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${Er.your_topic_here}`,s=Nt`<a + </dd>`)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${Ar.your_topic_here}`,s=Ot`<a href="${n.href}?subject=${encodeURIComponent(r)}" >${n.pathname}</a - >`,i=e.subjectPrefix||Nt`[${e.shortName}] <em>${Er.message_topic}</em>`,o=Nt`${Er.with_subject_line}${" "} - <kbd>${i}</kbd>`,a=new URL(e.wgPublicList,"https://lists.w3.org/Archives/Public/"),c=Nt`(<a href="${a}" rel="discussion" - >${Er.archives}</a - >)`;t.push(Nt`<dd>${s} ${o} ${c}</dd>`)}return t}var Pr=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),s=r.cloneNode(!0);return Nt`<div class="head"> - ${e.logos.length?Nt`<p class="logos">${e.logos.map(xr)}</p>`:""} - ${r} ${Ar(e)} + >`,i=e.subjectPrefix||Ot`[${e.shortName}] <em>${Ar.message_topic}</em>`,o=Ot`${Ar.with_subject_line}${" "} + <kbd>${i}</kbd>`,a=new URL(e.wgPublicList,"https://lists.w3.org/Archives/Public/"),c=Ot`(<a href="${a}" rel="discussion" + >${Ar.archives}</a + >)`;t.push(Ot`<dd>${s} ${o} ${c}</dd>`)}return t}var Ir=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),s=r.cloneNode(!0);return Ot`<div class="head"> + ${e.logos.length?Ot`<p class="logos">${e.logos.map(_r)}</p>`:""} + ${r} ${Tr(e)} <p id="w3c-state"> <a href="https://www.w3.org/standards/types#reports" >${e.longStatus}</a > <time class="dt-published" datetime="${e.dashDate}" - >${Gt.format(e.publishDate)}</time + >${Vt.format(e.publishDate)}</time > </p> <dl> - ${e.thisVersion?Nt`<dt>${Er.this_version}</dt> + ${e.thisVersion?Ot`<dt>${Ar.this_version}</dt> <dd> <a class="u-url" href="${e.thisVersion}" >${e.thisVersion}</a > </dd>`:""} - ${"latestVersion"in e?Nt`<dt>${Er.latest_published_version}</dt> + ${"latestVersion"in e?Ot`<dt>${Ar.latest_published_version}</dt> <dd> - ${e.latestVersion?Nt`<a href="${e.latestVersion}" + ${e.latestVersion?Ot`<a href="${e.latestVersion}" >${e.latestVersion}</a >`:"none"} </dd>`:""} - ${e.edDraftURI?Nt` - <dt>${Er.latest_editors_draft}</dt> + ${e.edDraftURI?Ot` + <dt>${Ar.latest_editors_draft}</dt> <dd><a href="${e.edDraftURI}">${e.edDraftURI}</a></dd> `:""} - ${e.testSuiteURI?Nt` + ${e.testSuiteURI?Ot` <dt>Test suite:</dt> <dd><a href="${e.testSuiteURI}">${e.testSuiteURI}</a></dd> `:""} - ${e.implementationReportURI?Nt` + ${e.implementationReportURI?Ot` <dt>Implementation report:</dt> <dd> <a href="${e.implementationReportURI}" @@ -314,48 +313,48 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} > </dd> `:""} - ${e.prevVersion?Nt` + ${e.prevVersion?Ot` <dt>Previous version:</dt> <dd><a href="${e.prevVersion}">${e.prevVersion}</a></dd> `:""} - ${e.isCGFinal?"":Nt` - ${e.prevED?Nt` + ${e.isCGFinal?"":Ot` + ${e.prevED?Ot` <dt>Previous editor's draft:</dt> <dd><a href="${e.prevED}">${e.prevED}</a></dd> `:""} `} - ${e.editors.length?Nt` - <dt>${e.editors.length>1?Er.editors:Er.editor}</dt> - ${Sr(e,"editors")} + ${e.editors.length?Ot` + <dt>${e.editors.length>1?Ar.editors:Ar.editor}</dt> + ${Rr(e,"editors")} `:""} - ${e.formerEditors.length?Nt` + ${e.formerEditors.length?Ot` <dt> - ${e.formerEditors.length>1?Er.former_editors:Er.former_editor} + ${e.formerEditors.length>1?Ar.former_editors:Ar.former_editor} </dt> - ${Sr(e,"formerEditors")} + ${Rr(e,"formerEditors")} `:""} - ${e.authors.length?Nt` - <dt>${e.authors.length>1?Er.authors:Er.author}</dt> - ${Sr(e,"authors")} + ${e.authors.length?Ot` + <dt>${e.authors.length>1?Ar.authors:Ar.author}</dt> + ${Rr(e,"authors")} `:""} - ${e.github||e.wgPublicList?Nt`<dt>${Er.feedback}</dt> - ${Lr(e)}`:""} + ${e.github||e.wgPublicList?Ot`<dt>${Ar.feedback}</dt> + ${Pr(e)}`:""} </dl> - ${e.alternateFormats?Nt`<p> + ${e.alternateFormats?Ot`<p> ${t.multipleAlternates?"This document is also available in these non-normative formats:":"This document is also available in this non-normative format:"} ${t.alternatesHTML} </p>`:""} - ${n||Nt`<p class="copyright"> + ${n||Ot`<p class="copyright"> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright" >Copyright</a > © ${e.copyrightStart?`${e.copyrightStart}-`:""}${e.publishYear} - ${e.additionalCopyrightHolders?Nt` ${[e.additionalCopyrightHolders]} & `:""} + ${e.additionalCopyrightHolders?Ot` ${[e.additionalCopyrightHolders]} & `:""} the Contributors to the ${s.childNodes} Specification, published by the <a href="${e.wgURI}">${e.wg}</a> under the - ${e.isCGFinal?Nt` + ${e.isCGFinal?Ot` <a href="https://www.w3.org/community/about/agreements/fsa/" >W3C Community Final Specification Agreement (FSA)</a >. A human-readable @@ -364,7 +363,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >summary</a > is available. - `:Nt` + `:Ot` <a href="https://www.w3.org/community/about/agreements/cla/" >W3C Community Contributor License Agreement (CLA)</a >. A human-readable @@ -376,47 +375,47 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} `} </p>`} <hr title="Separator for header" /> - </div>`};const Ir=rn({en:{sotd:"Status of This Document",status_at_publication:Nt`This section describes the status of this + </div>`};const Dr=sn({en:{sotd:"Status of This Document",status_at_publication:Ot`This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="https://www.w3.org/TR/">W3C technical reports index</a> at - https://www.w3.org/TR/.`},ko:{sotd:"현재 문서의 상태",status_at_publication:Nt`이 부분은 현재 문서의 발행 당시 상태에 대해 + https://www.w3.org/TR/.`},ko:{sotd:"현재 문서의 상태",status_at_publication:Ot`이 부분은 현재 문서의 발행 당시 상태에 대해 기술합니다. W3C 발행 문서의 최신 목록 및 테크니컬 리포트 최신판을 https://www.w3.org/TR/ 의 <a href="https://www.w3.org/TR/">W3C technical reports index</a> 에서 - 열람할 수 있습니다.`},zh:{sotd:"关于本文档",status_at_publication:Nt`本章节描述了本文档的发布状态。W3C的文档列表和最新版本可通过<a href="https://www.w3.org/TR/">W3C技术报告</a>索引访问。`},ja:{sotd:"この文書の位置付け",status_at_publication:Nt`この節には、公開時点でのこの文書の位置づけが記されている。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 + 열람할 수 있습니다.`},zh:{sotd:"关于本文档",status_at_publication:Ot`本章节描述了本文档的发布状态。W3C的文档列表和最新版本可通过<a href="https://www.w3.org/TR/">W3C技术报告</a>索引访问。`},ja:{sotd:"この文書の位置付け",status_at_publication:Ot`この節には、公開時点でのこの文書の位置づけが記されている。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 <a href="https://www.w3.org/TR/">W3C technical reports index</a> - (https://www.w3.org/TR/)`},nl:{sotd:"Status van dit document"},es:{sotd:"Estado de este Document",status_at_publication:Nt`Esta sección describe el estado del presente + (https://www.w3.org/TR/)`},nl:{sotd:"Status van dit document"},es:{sotd:"Estado de este Document",status_at_publication:Ot`Esta sección describe el estado del presente documento al momento de su publicación. Una lista de las publicaciones actuales del W3C y la última revisión del presente informe técnico puede hallarse en http://www.w3.org/TR/ <a href="https://www.w3.org/TR/">el índice de informes técnicos</a> del - W3C.`},de:{sotd:"Status dieses Dokuments",status_at_publication:Nt`Dieser Abschnitt beschreibt den Status des + W3C.`},de:{sotd:"Status dieses Dokuments",status_at_publication:Ot`Dieser Abschnitt beschreibt den Status des Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann im <a href="https://www.w3.org/TR/">W3C technical reports index</a> unter - https://www.w3.org/TR/ abgerufen werden.`}}),Dr="https://www.w3.org/2021/Process-20211102/";function Nr(e){return/^[aeiou]/i.test(e)?`an ${e}`:`a ${e}`}var Or=(e,t)=>Nt` - <h2>${Ir.sotd}</h2> - ${e.isPreview?jr(e):""} - ${e.isUnofficial?function(e){const{additionalContent:t}=e;return Nt` + https://www.w3.org/TR/ abgerufen werden.`}}),Nr="https://www.w3.org/2021/Process-20211102/";function Or(e){return/^[aeiou]/i.test(e)?`an ${e}`:`a ${e}`}var jr=(e,t)=>Ot` + <h2>${Dr.sotd}</h2> + ${e.isPreview?Mr(e):""} + ${e.isUnofficial?function(e){const{additionalContent:t}=e;return Ot` <p> This document is a draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organization. </p> ${t} - `}(t):e.isTagFinding?t.additionalContent:e.isNoTrack?function(e,t){const{isMO:n}=e,{additionalContent:r}=t;return Nt` + `}(t):e.isTagFinding?t.additionalContent:e.isNoTrack?function(e,t){const{isMO:n}=e,{additionalContent:r}=t;return Ot` <p> This document is merely a W3C-internal ${n?"member-confidential":""} document. It has no official standing of any kind and does not represent consensus of the W3C Membership. </p> ${r} - `}(e,t):Nt` - <p><em>${Ir.status_at_publication}</em></p> - ${e.isMemberSubmission?function(e,t){return Nt` + `}(e,t):Ot` + <p><em>${Dr.status_at_publication}</em></p> + ${e.isMemberSubmission?function(e,t){return Ot` ${t.additionalContent} - ${e.isMemberSubmission?function(e){const t=`https://www.w3.org/Submission/${e.publishDate.getUTCFullYear()}/${e.submissionCommentNumber}/Comment/`,n="PP2017"===e.wgPatentPolicy?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/Consortium/Patent-Policy/";return Nt`<p> + ${e.isMemberSubmission?function(e){const t=`https://www.w3.org/Submission/${e.publishDate.getUTCFullYear()}/${e.submissionCommentNumber}/Comment/`,n="PP2017"===e.wgPatentPolicy?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/Consortium/Patent-Policy/";return Ot`<p> By publishing this document, W3C acknowledges that the <a href="${e.thisVersion}">Submitting Members</a> have made a formal Submission request to W3C for discussion. Publication of this document by @@ -438,35 +437,35 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >list of acknowledged W3C Member Submissions</a >. </p>`}(e):""} - `}(e,t):Nt` + `}(e,t):Ot` ${e.sotdAfterWGinfo?"":t.additionalContent} - ${e.overrideStatus?"":Nt` ${function(e){if(!e.wg)return;let t=null;if(e.isRec&&e.revisionTypes&&e.revisionTypes.length){const n=e.revisionTypes.includes("proposed-addition"),r=e.revisionTypes.includes("proposed-correction"),s=e.revisionTypes.includes("addition"),i=e.revisionTypes.includes("correction");n&&r||s&&i?t=Nt`It includes - ${n?Nt`<a href="${Dr}#proposed-amendments"> + ${e.overrideStatus?"":Ot` ${function(e){if(!e.wg)return;let t=null;if(e.isRec&&e.revisionTypes&&e.revisionTypes.length){const n=e.revisionTypes.includes("proposed-addition"),r=e.revisionTypes.includes("proposed-correction"),s=e.revisionTypes.includes("addition"),i=e.revisionTypes.includes("correction");n&&r||s&&i?t=Ot`It includes + ${n?Ot`<a href="${Nr}#proposed-amendments"> proposed amendments</a - >`:Nt`<a href="${Dr}#candidate-amendments"> + >`:Ot`<a href="${Nr}#candidate-amendments"> candidate amendments</a >`}, introducing substantive changes and new features since the previous - Recommendation.`:n||s?t=Nt`It includes - ${n?Nt`<a href="${Dr}#proposed-addition"> + Recommendation.`:n||s?t=Ot`It includes + ${n?Ot`<a href="${Nr}#proposed-addition"> proposed additions</a - >`:Nt`<a href="${Dr}#candidate-addition"> + >`:Ot`<a href="${Nr}#candidate-addition"> candidate additions</a >`}, - introducing new features since the previous Recommendation.`:(r||i)&&(t=Nt`It includes - ${r?Nt`<a href="${Dr}#proposed-correction"> + introducing new features since the previous Recommendation.`:(r||i)&&(t=Ot`It includes + ${r?Ot`<a href="${Nr}#proposed-correction"> proposed corrections</a - >`:Nt`<a href="${Dr}#candidate-correction"> + >`:Ot`<a href="${Nr}#candidate-correction"> candidate corrections</a - >`}.`)}const n=Br[e.specStatus]?Nt` using the - <a href="${Dr}#recs-and-notes" - >${Br[e.specStatus]} track</a - >`:"";return Nt`<p> - This document was published by ${e.wgHTML} as - ${Nr(e.longStatus)}${n}. ${t} + >`}.`)}const n=Gr[e.specStatus]?Ot` using the + <a href="${Nr}#recs-and-notes" + >${Gr[e.specStatus]} track</a + >`:"";return Ot`<p> + This document was published by ${zr(e)} as + ${Or(e.longStatus)}${n}. ${t} </p>`}(e)} `} ${e.sotdAfterWGinfo?t.additionalContent:""} - ${e.isRec?function(e){const{updateableRec:t,revisionTypes:n=[],revisedRecEnd:r}=e;let s="";n.includes("proposed-addition")?s="additions":n.includes("proposed-correction")&&(s="corrections");return Nt` + ${e.isRec?function(e){const{updateableRec:t,revisionTypes:n=[],revisedRecEnd:r}=e;let s="";n.includes("proposed-addition")?s="additions":n.includes("proposed-correction")&&(s="corrections");return Ot` <p> W3C recommends the wide deployment of this specification as a standard for the Web. @@ -481,59 +480,59 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >royalty-free licensing</a > for implementations. - ${t?Nt`Future updates to this Recommendation may incorporate - <a href="${Dr}#allow-new-features">new features</a>.`:""} + ${t?Ot`Future updates to this Recommendation may incorporate + <a href="${Nr}#allow-new-features">new features</a>.`:""} </p> - ${n.includes("addition")?Nt`<p class="addition"> + ${n.includes("addition")?Ot`<p class="addition"> Candidate additions are marked in the document. </p>`:""} - ${n.includes("correction")?Nt`<p class="correction"> + ${n.includes("correction")?Ot`<p class="correction"> Candidate corrections are marked in the document. </p>`:""} - ${n.includes("proposed-addition")?Nt`<p class="addition proposed"> + ${n.includes("proposed-addition")?Ot`<p class="addition proposed"> Proposed additions are marked in the document. </p>`:""} - ${n.includes("proposed-correction")?Nt`<p class="correction proposed"> + ${n.includes("proposed-correction")?Ot`<p class="correction proposed"> Proposed corrections are marked in the document. </p>`:""} - ${s?Nt`<p> + ${s?Ot`<p> The W3C Membership and other interested parties are invited to review the proposed ${s} and send comments through - ${Gt.format(r)}. Advisory Committee Representatives + ${Vt.format(r)}. Advisory Committee Representatives should consult their <a href="https://www.w3.org/2002/09/wbs/myQuestionnaires" >WBS questionnaires</a >. </p>`:""} - `}(e):function(e){let t=null,n=null,r=Nt`Publication as ${Nr(e.textStatus)} does not - imply endorsement by W3C and its Members.`,s=Nt`<p> + `}(e):function(e){let t=null,n=null,r=Ot`Publication as ${Or(e.textStatus)} does not + imply endorsement by W3C and its Members.`,s=Ot`<p> This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress. - ${e.updateableRec?Nt`Future updates to this specification may incorporate - <a href="${Dr}#allow-new-features">new features</a>.`:""} - </p>`;"DISC"===e.specStatus&&(s=Nt`<p> + ${e.updateableRec?Ot`Future updates to this specification may incorporate + <a href="${Nr}#allow-new-features">new features</a>.`:""} + </p>`;"DISC"===e.specStatus&&(s=Ot`<p> Publication as a Discontinued Draft implies that this document is no longer intended to advance or to be maintained. It is inappropriate to cite this document as other than abandoned work. - </p>`);const i=Nt`<p> + </p>`);const i=Ot`<p> This document is maintained and updated at any time. Some parts of this document are work in progress. - </p>`;switch(e.specStatus){case"STMT":r=Nt`<p> + </p>`;switch(e.specStatus){case"STMT":r=Ot`<p> A W3C Statement is a specification that, after extensive consensus-building, has received the endorsement of the <abbr title="World Wide Web Consortium">W3C</abbr> and its Members. - </p>`;break;case"RY":r=Nt`<p>W3C recommends the wide usage of this registry.</p> + </p>`;break;case"RY":r=Ot`<p>W3C recommends the wide usage of this registry.</p> <p> A W3C Registry is a specification that, after extensive consensus-building, has received the endorsement of the <abbr title="World Wide Web Consortium">W3C</abbr> and its Members. - </p>`;break;case"CRD":t=Nt`A Candidate Recommendation Draft integrates + </p>`;break;case"CRD":t=Ot`A Candidate Recommendation Draft integrates changes from the previous Candidate Recommendation that the Working Group - intends to include in a subsequent Candidate Recommendation Snapshot.`,"LS"===e.pubMode&&(s=i);break;case"CRYD":t=Nt`A Candidate Registry Draft integrates changes + intends to include in a subsequent Candidate Recommendation Snapshot.`,"LS"===e.pubMode&&(s=i);break;case"CRYD":t=Ot`A Candidate Registry Draft integrates changes from the previous Candidate Registry Snapshot that the Working Group - intends to include in a subsequent Candidate Registry Snapshot.`,"LS"===e.pubMode&&(s=i);break;case"CRY":t=Nt`A Candidate Registry Snapshot has received - <a href="${Dr}#dfn-wide-review">wide review</a>.`,n=Nt`<p> + intends to include in a subsequent Candidate Registry Snapshot.`,"LS"===e.pubMode&&(s=i);break;case"CRY":t=Ot`A Candidate Registry Snapshot has received + <a href="${Nr}#dfn-wide-review">wide review</a>.`,n=Ot`<p> The W3C Membership and other interested parties are invited to review the document and send comments through ${e.humanPREnd}. Advisory Committee Representatives should consult their @@ -541,34 +540,37 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >WBS questionnaires</a >. Note that substantive technical comments were expected during the Candidate Recommendation review period that ended ${e.humanCREnd}. - </p>`;break;case"CR":t=Nt`A Candidate Recommendation Snapshot has received - <a href="${Dr}#dfn-wide-review">wide review</a>, is intended to + </p>`;break;case"CR":t=Ot`A Candidate Recommendation Snapshot has received + <a href="${Nr}#dfn-wide-review">wide review</a>, is intended to gather <a href="${e.implementationReportURI}">implementation experience</a>, and has commitments from Working Group members to <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements" >royalty-free licensing</a > - for implementations.`,s=Nt`${e.updateableRec?Nt`Future updates to this specification may incorporate - <a href="${Dr}#allow-new-features">new features</a>.`:""}`,n="LS"===e.pubMode?Nt`<p> + for implementations.`,s=Ot`${e.updateableRec?Ot`Future updates to this specification may incorporate + <a href="${Nr}#allow-new-features">new features</a>.`:""}`,n="LS"===e.pubMode?Ot`<p> Comments are welcome at any time but most especially before - ${Gt.format(e.crEnd)}. - </p>`:Nt`<p> + ${Vt.format(e.crEnd)}. + </p>`:Ot`<p> This Candidate Recommendation is not expected to advance to Proposed - Recommendation any earlier than ${Gt.format(e.crEnd)}. - </p>`;break;case"PR":n=Nt`<p> + Recommendation any earlier than ${Vt.format(e.crEnd)}. + </p>`;break;case"PR":n=Ot`<p> The W3C Membership and other interested parties are invited to review - the document and send comments through ${Gt.format(e.prEnd)}. + the document and send comments through ${Vt.format(e.prEnd)}. Advisory Committee Representatives should consult their <a href="https://www.w3.org/2002/09/wbs/myQuestionnaires" >WBS questionnaires</a >. Note that substantive technical comments were expected during the Candidate Recommendation review period that ended - ${Gt.format(e.crEnd)}. - </p>`;break;case"DNOTE":case"NOTE":r=Nt`${e.textStatus}s are not endorsed by - <abbr title="World Wide Web Consortium">W3C</abbr> nor its Members.`}return Nt`<p>${r} ${t}</p> + ${Vt.format(e.crEnd)}. + </p>`;break;case"DNOTE":r=Ot`${e.textStatus}s are not endorsed by + <abbr title="World Wide Web Consortium">W3C</abbr> nor its Members.`;break;case"NOTE":r=Ot`This ${e.textStatus} is endorsed by + ${zr(e)}, but is not endorsed by + <abbr title="World Wide Web Consortium">W3C</abbr> itself nor its + Members.`}return Ot`<p>${r} ${t}</p> ${s} ${n}`}(e)} - ${function(e){const{isNote:t,isRegistry:n,wgId:r,multipleWGs:s,wgPatentHTML:i,wgPatentURI:o,wgPatentPolicy:a}=e,c="PP2017"===a?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/Consortium/Patent-Policy/",l=t||n?Nt` + ${function(e){const{isNote:t,isRegistry:n,wgId:r,multipleWGs:s,wgPatentHTML:i,wgPatentURI:o,wgPatentPolicy:a}=e,c="PP2017"===a?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/Consortium/Patent-Policy/",l=t||n?Ot` The <a href="${c}" >${"PP2017"===a?"1 August 2017 ":""}W3C Patent @@ -576,17 +578,17 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} > does not carry any licensing requirements or commitments on this document. - `:Nt` + `:Ot` This document was produced by ${s?"groups":"a group"} operating under the <a href="${c}" >${"PP2017"===a?"1 August 2017 ":""}W3C Patent Policy</a >. - `;return Nt`<p data-deliverer="${t||n?r:null}"> + `;return Ot`<p data-deliverer="${t||n?r:null}"> ${l} - ${t||n?"":Nt` - ${s?Nt` W3C maintains ${i} `:Nt` + ${t||n?"":Ot` + ${s?Ot` W3C maintains ${i} `:Ot` W3C maintains a <a href="${[o]}" rel="disclosure" >public list of any patent disclosures</a @@ -605,17 +607,17 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} </p>`}(e)} <p> This document is governed by the - <a id="w3c_process_revision" href="${Dr}" + <a id="w3c_process_revision" href="${Nr}" >2 November 2021 W3C Process Document</a >. </p> `} `} ${t.additionalSections} - `;function jr(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return Nt`<details class="annoying-warning" open=""> + `;function Mr(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return Ot`<details class="annoying-warning" open=""> <summary> This is a - preview${t&&n?Nt` + preview${t&&n?Ot` of pull request <a href="${t}">#${n}</a> `:""} @@ -623,25 +625,25 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} <p> Do not attempt to implement this version of the specification. Do not reference this version as authoritative in any way. - ${r?Nt` + ${r?Ot` Instead, see <a href="${r}">${r}</a> for the Editor's draft. `:""} </p> - </details>`}var Mr=(e,t)=>Nt` - <h2>${Ir.sotd}</h2> - ${e.isPreview?jr(e):""} + </details>`}function zr(e){return Array.isArray(e.wg)?dn(e.wg,((t,n)=>Ot`the <a href="${e.wgURI[n]}">${t}</a>`)):e.wg?Ot`the <a href="${e.wgURI}">${e.wg}</a>`:void 0}var Ur=(e,t)=>Ot` + <h2>${Dr.sotd}</h2> + ${e.isPreview?Mr(e):""} <p> This specification was published by the <a href="${e.wgURI}">${e.wg}</a>. It is not a W3C Standard nor is it on the W3C Standards Track. - ${e.isCGFinal?Nt` + ${e.isCGFinal?Ot` Please note that under the <a href="https://www.w3.org/community/about/agreements/final/" >W3C Community Final Specification Agreement (FSA)</a > other conditions apply. - `:Nt` + `:Ot` Please note that under the <a href="https://www.w3.org/community/about/agreements/cla/" >W3C Community Contributor License Agreement (CLA)</a @@ -654,19 +656,19 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >. </p> ${e.sotdAfterWGinfo?"":t.additionalContent} - ${!e.github&&e.wgPublicList?function(e,t){const{mailToWGPublicListWithSubject:n,mailToWGPublicListSubscription:r}=t,{wgPublicList:s,subjectPrefix:i}=e;return Nt`<p> + ${!e.github&&e.wgPublicList?function(e,t){const{mailToWGPublicListWithSubject:n,mailToWGPublicListSubscription:r}=t,{wgPublicList:s,subjectPrefix:i}=e;return Ot`<p> If you wish to make comments regarding this document, please send them to <a href="${n}">${s}@w3.org</a> (<a href="${r}">subscribe</a>, - <a href="${`https://lists.w3.org/Archives/Public/${s}/`}">archives</a>)${i?Nt` with <code>${i}</code> at the start of your email's + <a href="${`https://lists.w3.org/Archives/Public/${s}/`}">archives</a>)${i?Ot` with <code>${i}</code> at the start of your email's subject`:""}. </p>`}(e,t):""} - ${e.github?function(e,t){if(e.github||e.wgPublicList)return Nt`<p> - ${e.github?Nt` + ${e.github?function(e,t){if(e.github||e.wgPublicList)return Ot`<p> + ${e.github?Ot` <a href="${e.issueBase}">GitHub Issues</a> are preferred for discussion of this specification. `:""} - ${e.wgPublicList?Nt` + ${e.wgPublicList?Ot` ${e.github&&e.wgPublicList?"Alternatively, you can send comments to our mailing list.":"Comments regarding this document are welcome."} Please send them to <a href="${t.mailToWGPublicListWithSubject}" @@ -676,23 +678,23 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} <a href="${`https://lists.w3.org/Archives/Public/${e.wgPublicList}/`}" >archives</a - >)${e.subjectPrefix?Nt` with <code>${e.subjectPrefix}</code> at the start of your + >)${e.subjectPrefix?Ot` with <code>${e.subjectPrefix}</code> at the start of your email's subject`:""}. `:""} </p>`}(e,t):""} ${e.sotdAfterWGinfo?t.additionalContent:""} ${t.additionalSections} - `;const zr="w3c/headers";function Ur(e){return new URL(e,"https://www.w3.org/").href}const qr={LS:"WD",LD:"WD",FPWD:"WD","Member-SUBM":"SUBM"},Wr={DNOTE:"Group Draft Note",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",PER:"Proposed Edited Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Draft Registry",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},Fr={...Wr,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},Br={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},Hr=["DNOTE","NOTE","STMT"],Gr=["CR","CRD","DISC","FPWD","PER","PR","REC","RSCND","WD"],Vr=["DRY","CRY","CRYD","RY"],Yr=["draft-finding","finding","editor-draft-finding"],Kr=["CG-DRAFT","CG-FINAL"],Zr=["BG-DRAFT","BG-FINAL"],Jr=[...Kr,...Zr],Xr=[...Hr,...Gr,...Vr],Qr=["base",...Kr,...Zr,"editor-draft-finding","draft-finding","finding","MO","unofficial"],es=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/Consortium/Legal/copyright-documents"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),ts=["PP2017","PP2020"];function ns(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Bt.format(r);return new Date(e)}return Sn(Pn`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,zr),new Date(Bt.format(new Date))}function rs(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){Rn(Pn`ReSpec does not support automated SotD generation for TAG findings.`,zr,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var ss=Object.freeze({__proto__:null,W3CNotes:Hr,bgStatus:Zr,cgStatus:Kr,cgbgStatus:Jr,licenses:es,name:zr,noTrackStatus:Qr,recTrackStatus:Gr,registryTrackStatus:Vr,run:async function(e){if(e.isBasic="base"===e.specStatus,e.isCGBG=Jr.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isEd="ED"===e.specStatus,e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Hr.includes(e.specStatus),e.isNoTrack=Qr.includes(e.specStatus),e.isPER="PER"===e.specStatus,e.isPR="PR"===e.specStatus,e.isRecTrack=Gr.includes(e.specStatus),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRegistry=Vr.includes(e.specStatus),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isTagFinding=Yr.includes(e.specStatus),e.isUnofficial="unofficial"===e.specStatus,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(es.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=Pn`Please set - ${"[license]"} to one of: ${An([...es.keys()].filter((e=>e)),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;Sn(t,zr,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=Pn`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;Sn(Pn`License "\`${e.license}\`" is not allowed for W3C Specifications.`,zr,{hint:t})}return es.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=Fr[e.specStatus],e.textStatus=Wr[e.specStatus],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=Pn`Please set ${"[shortName]"} to a short name for the specification.`;Sn(Pn`The ${"[shortName]"} configuration option is required for this kind of document.`,zr,{hint:e})}if(e.publishDate=ns(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=ns(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=Pn`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;Sn("W3C Process requires a either a link to a public repository or mailing list.",zr,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=Pn`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;Rn(Pn`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,zr,{hint:e})}const t=function(e){const{specStatus:t,group:n}=e;if(Xr.includes(t)||"wg"===e.groupType)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}return""}(e);if(t&&!e.thisVersion){const n=qr[e.specStatus]||e.specStatus,{shortName:r,publishDate:s}=e,i=`${n}-${r}-${on(s)}`,o=[...Xr,"Member-SUBM"].includes(e.specStatus)?`${s.getUTCFullYear()}/`:"";e.thisVersion=Ur(`${t}/${o}${i}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=Wr[e.specStatus],n=e.latestVersion?new URL(Ur(e.latestVersion)):null;if(!e.wg){return void Sn(Pn`The ${"[group]"} configuration option is required for this kind of document (${t}).`,zr)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){Sn(Pn`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,zr,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?Ur(e.latestVersion):Ur(`${t}/${e.shortName}/`)),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",...Xr].includes(e.specStatus)){const t=Pn`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;Sn(Pn`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,zr,{hint:t})}}(e);const n=`${t}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){Sn(Pn`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,zr)}e.previousPublishDate=ns(e,"previousPublishDate");const r=qr[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=Bt.format(e.publishDate);e.thisVersion=Ur(`${n}-${t}`);const r=Bt.format(e.previousPublishDate);e.prevVersion=Ur(`${n}-${r}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const n=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,i=on(e.previousPublishDate);e.prevVersion=Ur(`${t}/${n}/${r}-${s}-${i}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=Ur(`${t}/${e.prevRecShortname}`));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(0===e.editors.length){const e=Pn`Add one or more editors using the ${"[editors]"} configuration option.`;Sn("At least one editor is required.",zr,{hint:e})}else e.editors.length&&e.isRecTrack&&e.editors.forEach(((e,t)=>{if(e.w3cid)return;const n=Pn`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;Sn(Pn`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,zr,{hint:n})}));if(e.alternateFormats?.some((({uri:e,label:t})=>!e||!t))){Sn(Pn`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,zr)}if(e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.isRec&&!e.errata&&!e.revisionTypes?.length){const e=Pn`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;Sn("Recommendations must have an errata link.",zr,{hint:e})}e.dashDate=Bt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=Bt.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every((e=>ts.includes(e)))){const e=Pn`Invalid ${"[wgPatentPolicy]"} value(s): ${Tn([...t].filter((e=>!ts.includes(e))))}.`,n=`Please use one of: ${An(ts)}.`;Sn(e,zr,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=Pn`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;Sn(e,zr,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||Xr.includes(e.specStatus);if(e.historyURI&&!t){const t=Pn`Please remove ${"[historyURI]"}.`;return Sn(Pn`The ${"[historyURI]"} can't be used with non /TR/ documents.`,zr,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??e.shortName,"https://www.w3.org/standards/history/");if(e.historyURI&&t||["FPWD","DNOTE","NOTE","DRY"].includes(e.specStatus))return void(e.historyURI=n.href);try{const t=await fetch(n,{method:"HEAD"});t.ok&&(e.historyURI=t.url)}catch{}}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const s={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&un(e.alternateFormats.map((({label:e})=>e)),((t,n)=>{const r=e.alternateFormats[n];return Nt`<a + `;const qr="w3c/headers";function Wr(e){return new URL(e,"https://www.w3.org/").href}const Fr={LS:"WD",LD:"WD",FPWD:"WD","Member-SUBM":"SUBM"},Br={DNOTE:"Group Draft Note",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",PER:"Proposed Edited Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Draft Registry",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},Hr={...Br,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},Gr={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},Vr=["DNOTE","NOTE","STMT"],Yr=["CR","CRD","DISC","FPWD","PER","PR","REC","RSCND","WD"],Kr=["DRY","CRY","CRYD","RY"],Zr=["draft-finding","finding","editor-draft-finding"],Jr=["CG-DRAFT","CG-FINAL"],Xr=["BG-DRAFT","BG-FINAL"],Qr=[...Jr,...Xr],es=[...Vr,...Yr,...Kr],ts=["base",...Jr,...Xr,"editor-draft-finding","draft-finding","finding","MO","unofficial"],ns=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/Consortium/Legal/copyright-documents"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),rs=["PP2017","PP2020"];function ss(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Ht.format(r);return new Date(e)}return Rn(In`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,qr),new Date(Ht.format(new Date))}function is(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){En(In`ReSpec does not support automated SotD generation for TAG findings.`,qr,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var os=Object.freeze({__proto__:null,W3CNotes:Vr,bgStatus:Xr,cgStatus:Jr,cgbgStatus:Qr,licenses:ns,name:qr,noTrackStatus:ts,recTrackStatus:Yr,registryTrackStatus:Kr,run:async function(e){if(e.isBasic="base"===e.specStatus,e.isCGBG=Qr.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isEd="ED"===e.specStatus,e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Vr.includes(e.specStatus),e.isNoTrack=ts.includes(e.specStatus),e.isPER="PER"===e.specStatus,e.isPR="PR"===e.specStatus,e.isRecTrack=Yr.includes(e.specStatus),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRegistry=Kr.includes(e.specStatus),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isTagFinding=Zr.includes(e.specStatus),e.isUnofficial="unofficial"===e.specStatus,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(ns.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=In`Please set + ${"[license]"} to one of: ${Tn([...ns.keys()].filter((e=>e)),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;Rn(t,qr,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=In`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;Rn(In`License "\`${e.license}\`" is not allowed for W3C Specifications.`,qr,{hint:t})}return ns.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=Hr[e.specStatus],e.textStatus=Br[e.specStatus],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=In`Please set ${"[shortName]"} to a short name for the specification.`;Rn(In`The ${"[shortName]"} configuration option is required for this kind of document.`,qr,{hint:e})}if(e.publishDate=ss(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=ss(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=In`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;Rn("W3C Process requires a either a link to a public repository or mailing list.",qr,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=In`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;En(In`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,qr,{hint:e})}const t=function(e){const{specStatus:t,group:n}=e;if(es.includes(t)||"wg"===e.groupType)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}return""}(e);if(t&&!e.thisVersion){const n=Fr[e.specStatus]||e.specStatus,{shortName:r,publishDate:s}=e,i=`${n}-${r}-${an(s)}`,o=[...es,"Member-SUBM"].includes(e.specStatus)?`${s.getUTCFullYear()}/`:"";e.thisVersion=Wr(`${t}/${o}${i}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=Br[e.specStatus],n=e.latestVersion?new URL(Wr(e.latestVersion)):null;if(!e.wg){return void Rn(In`The ${"[group]"} configuration option is required for this kind of document (${t}).`,qr)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){Rn(In`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,qr,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?Wr(e.latestVersion):Wr(`${t}/${e.shortName}/`)),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",...es].includes(e.specStatus)){const t=In`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;Rn(In`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,qr,{hint:t})}}(e);const n=`${t}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){Rn(In`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,qr)}e.previousPublishDate=ss(e,"previousPublishDate");const r=Fr[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=Ht.format(e.publishDate);e.thisVersion=Wr(`${n}-${t}`);const r=Ht.format(e.previousPublishDate);e.prevVersion=Wr(`${n}-${r}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const n=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,i=an(e.previousPublishDate);e.prevVersion=Wr(`${t}/${n}/${r}-${s}-${i}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=Wr(`${t}/${e.prevRecShortname}`));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(0===e.editors.length){const e=In`Add one or more editors using the ${"[editors]"} configuration option.`;Rn("At least one editor is required.",qr,{hint:e})}else e.editors.length&&e.isRecTrack&&e.editors.forEach(((e,t)=>{if(e.w3cid)return;const n=In`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;Rn(In`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,qr,{hint:n})}));if(e.alternateFormats?.some((({uri:e,label:t})=>!e||!t))){Rn(In`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,qr)}if(e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.isRec&&!e.errata&&!e.revisionTypes?.length){const e=In`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;Rn("Recommendations must have an errata link.",qr,{hint:e})}e.dashDate=Ht.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=Ht.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every((e=>rs.includes(e)))){const e=In`Invalid ${"[wgPatentPolicy]"} value(s): ${Ln([...t].filter((e=>!rs.includes(e))))}.`,n=`Please use one of: ${Tn(rs)}.`;Rn(e,qr,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=In`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;Rn(e,qr,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||es.includes(e.specStatus);if(e.historyURI&&!t){const t=In`Please remove ${"[historyURI]"}.`;return Rn(In`The ${"[historyURI]"} can't be used with non /TR/ documents.`,qr,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??e.shortName,"https://www.w3.org/standards/history/");if(e.historyURI&&t||["FPWD","DNOTE","NOTE","DRY"].includes(e.specStatus))return void(e.historyURI=n.href);try{const t=await fetch(n,{method:"HEAD"});t.ok&&(e.historyURI=t.url)}catch{}}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const s={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&dn(e.alternateFormats.map((({label:e})=>e)),((t,n)=>{const r=e.alternateFormats[n];return Ot`<a rel="alternate" href="${r.uri}" hreflang="${r?.lang??null}" type="${r?.type??null}" >${r.label}</a - >`}))}},i=(e.isCGBG?Pr:Tr)(e,s);document.body.prepend(i),document.body.classList.add("h-entry");const o=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!o.id){Sn("A Status of This Document must include at least on custom paragraph.",zr,{elements:[o],hint:"Add a `<p>` in the 'sotd' section that reflects the status of this specification."})}o.id=o.id||"sotd",o.classList.add("introductory");const a=[e.wg,e.wgURI,e.wgPatentURI];if(a.some((e=>Array.isArray(e)))&&!a.every((e=>Array.isArray(e)))){const e=Pn`Use the ${"[group]"} option with an array instead.`;Sn(Pn`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,zr,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgHTML=un(e.wg,((t,n)=>Nt`the <a href="${e.wgURI[n]}">${t}</a>`)),e.wgPatentHTML=un(e.wg,((t,n)=>Nt`a + >`}))}},i=(e.isCGBG?Ir:Lr)(e,s);document.body.prepend(i),document.body.classList.add("h-entry");const o=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!o.id){Rn("A Status of This Document must include at least on custom paragraph.",qr,{elements:[o],hint:"Add a `<p>` in the 'sotd' section that reflects the status of this specification."})}o.id=o.id||"sotd",o.classList.add("introductory");const a=[e.wg,e.wgURI,e.wgPatentURI];if(a.some((e=>Array.isArray(e)))&&!a.every((e=>Array.isArray(e)))){const e=In`Use the ${"[group]"} option with an array instead.`;Rn(In`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,qr,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgPatentHTML=dn(e.wg,((t,n)=>Ot`a <a href="${e.wgPatentURI[n]}" rel="disclosure" >public list of any patent disclosures (${t})</a - >`))):(e.multipleWGs=!1,e.wg&&(e.wgHTML=Nt`the <a href="${e.wgURI}">${e.wg}</a>`)),e.isPR&&!e.crEnd){Sn(Pn`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,zr)}if(e.isCR&&!e.crEnd){Sn(Pn`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,zr)}if(e.crEnd=ns(e,"crEnd"),e.isPr&&!e.prEnd){Sn(Pn`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,zr)}if(e.prEnd=ns(e,"prEnd"),e.isPER&&!e.perEnd){Sn(Pn`${"[specStatus]"} is "PER", but no ${"[perEnd]"} is specified.`,zr)}if(e.perEnd=ns(e,"perEnd"),e.hasOwnProperty("updateableRec")){const t=Pn`Add an ${"[`updateable-rec`|#updateable-rec-class]"} CSS class to the Status of This Document section instead.`;Rn("Configuration option `updateableRec` is deprecated.",zr,{hint:t}),e.updateableRec&&o.classList.add("updateable-rec")}e.updateableRec=o.classList.contains("updateable-rec");const c=["addition","correction","proposed-addition","proposed-correction"];if(e.isRec&&e.revisionTypes?.length>0){if(e.revisionTypes.some((e=>!c.includes(e)))){const t=Pn`${"[specStatus]"} is "REC" with unknown ${"[revisionTypes]"}: '${An(e.revisionTypes.filter((e=>!c.includes(e))))}'.`,n=Pn`The valid values for ${"[revisionTypes]"} are: ${An(c)}.`;Sn(t,zr,{hint:n})}if((e.revisionTypes.includes("proposed-addition")||e.revisionTypes.includes("addition"))&&!e.updateableRec){Sn(Pn`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as allowing new features.`,zr)}}if("REC"===e.specStatus&&e.updateableRec&&e.revisionTypes&&e.revisionTypes.length>0&&["proposed-addition","proposed-correction"].some((t=>e.revisionTypes.includes(t)))&&!e.revisedRecEnd){Sn(Pn`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,zr)}if(e.revisedRecEnd=ns(e,"revisedRecEnd"),e.noRecTrack&&Gr.includes(e.specStatus)){const t=Pn`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=An(Gr,{quotes:!0});Sn(t,zr,{hint:`Status **can't** be any of: ${n}.`})}if(o.classList.contains("override")||Nt.bind(o)`${function(e,t){const n={...rs(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?`?subject=${encodeURIComponent(e.subjectPrefix)}`:"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}};return(e.isCGBG?Mr:Or)(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=Pn`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;Sn(Pn`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,zr,{hint:e})}if(!e.implementationReportURI&&e.isPR){Rn(Pn`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).`,zr)}r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:nn(document.getElementById("w3c-state")?.textContent??"")})},status2text:Wr,status2track:Br,tagStatus:Yr,trStatus:Xr});const is={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},os="w3c/defaults",as={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},cs={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},ls={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var us=Object.freeze({__proto__:null,name:os,run:function(e){const t=!1!==e.lint&&{...is.lint,...ls.lint,...e.lint};Object.assign(e,{...is,...ls,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=Pn`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return Sn(Pn`The ${"[specStatus]"} configuration option is required.`,os,{hint:t}),void(e.specStatus="base")}if(void 0===Wr[t]){const n=Pn`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=Pn`set ${"[specStatus]"} to one of: ${An(Object.keys(Wr),{quotes:!0})}.`;return Sn(n,os,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...Kr,"unofficial","UD"].includes(t)){const n=Pn`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(Kr,{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Zr,"unofficial","UD"].includes(t)){const n=Pn`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(Zr,{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![...Xr,"unofficial","UD","ED"].includes(t)){const e=Pn`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;Sn(Pn`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,os,{hint:e})}break;case"other":if("tag"===r&&!["ED",...Xr,...Yr].includes(t)){const n=Pn`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(["ED",...Xr,...Yr],{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(e.specStatus)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=Pn`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",Sn(t,os,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...Gr,...Vr,...Hr,...Yr,"ED"].includes(t),s=n&&n.length&&r,i=["Member-SUBM"].includes(t);(s||i)&&(e.logos.unshift(as),"Member-SUBM"===t&&e.logos.push(cs))}(e)}});var ds=String.raw`@keyframes pop{ + >`))):e.multipleWGs=!1,e.isPR&&!e.crEnd){Rn(In`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,qr)}if(e.isCR&&!e.crEnd){Rn(In`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,qr)}if(e.crEnd=ss(e,"crEnd"),e.isPr&&!e.prEnd){Rn(In`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,qr)}if(e.prEnd=ss(e,"prEnd"),e.isPER&&!e.perEnd){Rn(In`${"[specStatus]"} is "PER", but no ${"[perEnd]"} is specified.`,qr)}if(e.perEnd=ss(e,"perEnd"),e.hasOwnProperty("updateableRec")){const t=In`Add an ${"[`updateable-rec`|#updateable-rec-class]"} CSS class to the Status of This Document section instead.`;En("Configuration option `updateableRec` is deprecated.",qr,{hint:t}),e.updateableRec&&o.classList.add("updateable-rec")}e.updateableRec=o.classList.contains("updateable-rec");const c=["addition","correction","proposed-addition","proposed-correction"];if(e.isRec&&e.revisionTypes?.length>0){if(e.revisionTypes.some((e=>!c.includes(e)))){const t=In`${"[specStatus]"} is "REC" with unknown ${"[revisionTypes]"}: '${Tn(e.revisionTypes.filter((e=>!c.includes(e))))}'.`,n=In`The valid values for ${"[revisionTypes]"} are: ${Tn(c)}.`;Rn(t,qr,{hint:n})}if((e.revisionTypes.includes("proposed-addition")||e.revisionTypes.includes("addition"))&&!e.updateableRec){Rn(In`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as allowing new features.`,qr)}}if("REC"===e.specStatus&&e.updateableRec&&e.revisionTypes&&e.revisionTypes.length>0&&["proposed-addition","proposed-correction"].some((t=>e.revisionTypes.includes(t)))&&!e.revisedRecEnd){Rn(In`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,qr)}if(e.revisedRecEnd=ss(e,"revisedRecEnd"),e.noRecTrack&&Yr.includes(e.specStatus)){const t=In`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=Tn(Yr,{quotes:!0});Rn(t,qr,{hint:`Status **can't** be any of: ${n}.`})}if(o.classList.contains("override")||Ot.bind(o)`${function(e,t){const n={...is(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?`?subject=${encodeURIComponent(e.subjectPrefix)}`:"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}};return(e.isCGBG?Ur:jr)(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=In`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;Rn(In`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,qr,{hint:e})}if(!e.implementationReportURI&&e.isPR){En(In`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).`,qr)}r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:rn(document.getElementById("w3c-state")?.textContent??"")})},status2text:Br,status2track:Gr,tagStatus:Zr,trStatus:es});const as={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},cs="w3c/defaults",ls={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},us={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},ds={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var ps=Object.freeze({__proto__:null,name:cs,run:function(e){const t=!1!==e.lint&&{...as.lint,...ds.lint,...e.lint};Object.assign(e,{...as,...ds,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=In`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return Rn(In`The ${"[specStatus]"} configuration option is required.`,cs,{hint:t}),void(e.specStatus="base")}if(void 0===Br[t]){const n=In`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=In`set ${"[specStatus]"} to one of: ${Tn(Object.keys(Br),{quotes:!0})}.`;return Rn(n,cs,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...Jr,"unofficial","UD"].includes(t)){const n=In`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=Tn(Jr,{quotes:!0});Rn(n,cs,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Xr,"unofficial","UD"].includes(t)){const n=In`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=Tn(Xr,{quotes:!0});Rn(n,cs,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![...es,"unofficial","UD","ED"].includes(t)){const e=In`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;Rn(In`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,cs,{hint:e})}break;case"other":if("tag"===r&&!["ED",...es,...Zr].includes(t)){const n=In`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=Tn(["ED",...es,...Zr],{quotes:!0});Rn(n,cs,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(e.specStatus)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=In`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",Rn(t,cs,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...Yr,...Kr,...Vr,...Zr,"ED"].includes(t),s=n&&n.length&&r,i=["Member-SUBM"].includes(t);(s||i)&&(e.logos.unshift(ls),"Member-SUBM"===t&&e.logos.push(us))}(e)}});var fs=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -747,71 +749,71 @@ 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",corsMode:"anonymous"}],t=document.createDocumentFragment();for(const n of e.map(Yt))t.appendChild(n);return t}();ms.appendChild(Nt`<link +}`;const hs=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=fs,document.head.appendChild(e),e}();var ms=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&hs.remove()}});function gs(){const e=Ot`<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 bs=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(Kt))t.appendChild(n);return t}();bs.appendChild(Ot`<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2021/base.css" class="removeOnSave" -/>`),document.head.querySelector("meta[name=viewport]")||ms.prepend(Nt`<meta +/>`),document.head.querySelector("meta[name=viewport]")||bs.prepend(Ot`<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" - />`),document.head.prepend(ms);var gs=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){const t=e.specStatus?.toUpperCase()??"";let n="";const r=[...Gr,...Vr,...Hr,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;case"MEMBER-SUBM":n="W3C-Member-SUBM";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}e.noToc||s("end-all",hs,{once:!0});const i=new URL(`/StyleSheets/TR/2021/${n}`,"https://www.w3.org/");var o;!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,i.href),s("beforesave",(o=i,e=>{const t=e.querySelector(`head link[href="${o}"]`);e.querySelector("head").append(t)}))}});const bs="core/github";let ys,ws;const vs=new Promise(((e,t)=>{ys=e,ws=e=>{Sn(e,bs),t(new Error(e))}})),$s=rn({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 ks=Object.freeze({__proto__:null,github:vs,name:bs,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void ys(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=Pn`Config option ${"[github]"} is missing property \`repoURL\`.`;return void ws(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=Pn`${"[github]"} configuration option is not a valid URL? (${n}).`;return void ws(e)}if("https://github.com"!==t.origin){const e=Pn`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void ws(e)}const[r,s]=t.pathname.split("/").filter((e=>e));if(!r||!s){const e=Pn`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void ws(e)}const i=e.github.branch||"gh-pages",o=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:o,atRiskBase:o,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{Rn("The `githubAPI` configuration option is private and should not be added manually.",bs)}if(!e.excludeGithubLinks){const n={key:$s.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:$s.file_a_bug,href:c.issueBase},{value:$s.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:o,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",o).href,commitHistoryURL:a.href};ys(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class xs{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(_s(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function _s(e){const t=new xs(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 Cs(e){const t=_s(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 Ss=Object.freeze({__proto__:null,name:"core/sections",restructure:Cs,run:function(){Cs(document.body)}});const Rs="core/data-include";function Es(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=an(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=Gn(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&Cs(e),n&&e.replaceWith(...e.childNodes)}(r,s,{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 As(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 s=await fetch(n);Es(await s.text(),r,n),t<3&&await As(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Sn(r,Rs,{elements:[e]})}}));await Promise.all(r)}var Ts=Object.freeze({__proto__:null,name:Rs,run:async function(){await As(document,1)}});const Ls="core/title",Ps=rn({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var Is=Object.freeze({__proto__:null,name:Ls,run:function(e){const t=document.querySelector("h1#title")||Nt`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Sn('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">`.',Ls,{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||`${Ps.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=nn(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=Nt` + />`),document.head.prepend(bs);var ys=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){const t=e.specStatus?.toUpperCase()??"";let n="";const r=[...Yr,...Kr,...Vr,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;case"MEMBER-SUBM":n="W3C-Member-SUBM";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}e.noToc||s("end-all",gs,{once:!0});const i=new URL(`/StyleSheets/TR/2021/${n}`,"https://www.w3.org/");var o;!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,i.href),s("beforesave",(o=i,e=>{const t=e.querySelector(`head link[href="${o}"]`);e.querySelector("head").append(t)}))}});const ws="core/github";let vs,$s;const ks=new Promise(((e,t)=>{vs=e,$s=e=>{Rn(e,ws),t(new Error(e))}})),xs=sn({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 _s=Object.freeze({__proto__:null,github:ks,name:ws,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void vs(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=In`Config option ${"[github]"} is missing property \`repoURL\`.`;return void $s(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=In`${"[github]"} configuration option is not a valid URL? (${n}).`;return void $s(e)}if("https://github.com"!==t.origin){const e=In`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void $s(e)}const[r,s]=t.pathname.split("/").filter((e=>e));if(!r||!s){const e=In`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void $s(e)}const i=e.github.branch||"gh-pages",o=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:o,atRiskBase:o,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{En("The `githubAPI` configuration option is private and should not be added manually.",ws)}if(!e.excludeGithubLinks){const n={key:xs.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:xs.file_a_bug,href:c.issueBase},{value:xs.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:o,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",o).href,commitHistoryURL:a.href};vs(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class Cs{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(Ss(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Ss(e){const t=new Cs(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 Rs(e){const t=Ss(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 Es=Object.freeze({__proto__:null,name:"core/sections",restructure:Rs,run:function(){Rs(document.body)}});const As="core/data-include";function Ts(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=cn(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=Vn(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&Rs(e),n&&e.replaceWith(...e.childNodes)}(r,s,{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 Ls(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 s=await fetch(n);Ts(await s.text(),r,n),t<3&&await Ls(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Rn(r,As,{elements:[e]})}}));await Promise.all(r)}var Ps=Object.freeze({__proto__:null,name:As,run:async function(){await Ls(document,1)}});const Is="core/title",Ds=sn({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var Ns=Object.freeze({__proto__:null,name:Is,run:function(e){const t=document.querySelector("h1#title")||Ot`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Rn('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">`.',Is,{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||`${Ds.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=rn(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=Ot` Preview of PR <a href="${n}">#${e.prNumber}</a>: - `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const Ds="w3c/level",Ns=rn({en:{level:"Level"}});var Os=Object.freeze({__proto__:null,name:Ds,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){Sn(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,Ds,{title:"Invalid level config.",elements:[t]})}else t.append(` ${Ns.level} ${n}`),document.title=`${document.title} ${Ns.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const js="w3c/abstract",Ms=rn({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var zs=Object.freeze({__proto__:null,name:js,run:async function(){const e=function(){const e=document.querySelector("#abstract");if(e)switch(e.localName){case"section":return e;case"div":return hn(e,"section");default:return Sn("The abstract should be a `<section>` element.",js,{elements:[e]}),e}const t=Ms.abstract.toLowerCase();for(const e of document.querySelectorAll("h2, h3, h4, h5, h6")){if(nn(e.textContent).toLowerCase()===t)return e.closest("section")}return null}();if(e)e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(Nt`<h2>${Ms.abstract}</h2>`);else{Sn('Document must have one `<section id="abstract">`.',js)}}});var Us=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=an(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const qs="core/dfn-abbr";function Ws(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 s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter((e=>e.trim())).concat(t).join("|")}var Fs=Object.freeze({__proto__:null,name:qs,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Ws(t);else{Sn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,qs,{elements:[t],title:"Error: unsupported."})}}}});const Bs=/^[a-z]+(\s+[a-z]+)+\??$/,Hs=/\B"([^"]*)"\B/,Gs=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Vs=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Ys=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ks=/^(?:\w+)\??$/,Zs=/^(\w+)\["([\w- ]*)"\]$/,Js=/\.?(\w+\(.*\)$)/,Xs=/\/(.+)/,Qs=/\[\[.+\]\]/;function ei(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Nt`<a + `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const Os="w3c/level",js=sn({en:{level:"Level"}});var Ms=Object.freeze({__proto__:null,name:Os,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){Rn(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,Os,{title:"Invalid level config.",elements:[t]})}else t.append(` ${js.level} ${n}`),document.title=`${document.title} ${js.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const zs="w3c/abstract",Us=sn({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var qs=Object.freeze({__proto__:null,name:zs,run:async function(){const e=function(){const e=document.querySelector("#abstract");if(e)switch(e.localName){case"section":return e;case"div":return mn(e,"section");default:return Rn("The abstract should be a `<section>` element.",zs,{elements:[e]}),e}const t=Us.abstract.toLowerCase();for(const e of document.querySelectorAll("h2, h3, h4, h5, h6")){if(rn(e.textContent).toLowerCase()===t)return e.closest("section")}return null}();if(e)e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(Ot`<h2>${Us.abstract}</h2>`);else{Rn('Document must have one `<section id="abstract">`.',zs)}}});var Ws=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=cn(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Fs="core/dfn-abbr";function Bs(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 s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter((e=>e.trim())).concat(t).join("|")}var Hs=Object.freeze({__proto__:null,name:Fs,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Bs(t);else{Rn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Fs,{elements:[t],title:"Error: unsupported."})}}}});const Gs=/^[a-z]+(\s+[a-z]+)+\??$/,Vs=/\B"([^"]*)"\B/,Ys=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Ks=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Zs=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Js=/^(?:\w+)\??$/,Xs=/^(\w+)\["([\w- ]*)"\]$/,Qs=/\.?(\w+\(.*\)$)/,ei=/\/(.+)/,ti=/\[\[.+\]\]/;function ni(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Ot`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></a - >`}function ti(e){const{identifier:t,parent:n,slotType:r,renderParent:s,args:i}=e,{identifier:o}=n||{},a="method"===r,c=a?Nt`(${ln(i,ni)})`:null,l=a?`(${i.join(", ")})`:"";return Nt`${n&&s?".":""}<a + >`}function ri(e){const{identifier:t,parent:n,slotType:r,renderParent:s,args:i}=e,{identifier:o}=n||{},a="method"===r,c=a?Ot`(${un(i,si)})`:null,l=a?`(${i.join(", ")})`:"";return Ot`${n&&s?".":""}<a data-xref-type="${r}" data-link-type="${r}" data-link-for="${o}" data-xref-for="${o}" data-lt="${`[[${t}]]${l}`}" ><code>[[${t}]]${c}</code></a - >`}function ni(e,t,n){if(t<n.length-1)return Nt`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),s=r.length>1,i=s?r[2]:r[0];return Nt`${s?"...":null}<var>${i}</var>`}function ri(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:s}=t||{};return Nt`${r?".":""}<a + >`}function si(e,t,n){if(t<n.length-1)return Ot`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),s=r.length>1,i=s?r[2]:r[0];return Ot`${s?"...":null}<var>${i}</var>`}function ii(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:s}=t||{};return Ot`${r?".":""}<a data-link-type="idl" data-xref-type="attribute|dict-member|const" data-link-for="${s}" data-xref-for="${s}" ><code>${n}</code></a - >`}function si(e){const{args:t,identifier:n,type:r,parent:s,renderParent:i}=e,{renderText:o,renderArgs:a}=e,{identifier:c}=s||{},l=ln(a||t,ni),u=`${n}(${t.join(", ")})`;return Nt`${s&&i?".":""}<a + >`}function oi(e){const{args:t,identifier:n,type:r,parent:s,renderParent:i}=e,{renderText:o,renderArgs:a}=e,{identifier:c}=s||{},l=un(a||t,si),u=`${n}(${t.join(", ")})`;return Ot`${s&&i?".":""}<a data-link-type="idl" data-xref-type="${r}" data-link-for="${c}" data-xref-for="${c}" data-lt="${u}" ><code>${o||n}</code></a - >${!o||a?Nt`<code>(${l})</code>`:""}`}function ii(e){const{identifier:t,enumValue:n,parent:r}=e,s=r?r.identifier:t;return Nt`"<a + >${!o||a?Ot`<code>(${l})</code>`:""}`}function ai(e){const{identifier:t,enumValue:n,parent:r}=e,s=r?r.identifier:t;return Ot`"<a data-link-type="idl" data-xref-type="enum-value" data-link-for="${s}" data-xref-for="${s}" data-lt="${n?null:"the-empty-string"}" ><code>${n}</code></a - >"`}function oi(e){const{identifier:t}=e;return Nt`"<a + >"`}function ci(e){const{identifier:t}=e;return Ot`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function ai(e){const{identifier:t,nullable:n}=e;return Nt`<a + >"`}function li(e){const{identifier:t,nullable:n}=e;return Ot`<a data-link-type="idl" data-cite="webidl" data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function ci(e){let t;try{t=function(e){const t=Qs.test(e),n=t?Xs:Js,[r,s]=e.split(n);if(t&&r&&!s)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(s).filter((e=>e&&e.trim())).map((e=>e.trim())),o=!e.includes("/"),a=[];for(;i.length;){const t=i.pop();if(Gs.test(t)){const[,e,n,r,s]=t.match(Gs),i=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=s?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:i,renderParent:o,renderText:c,renderArgs:l})}else if(Zs.test(t)){const[,e,n]=t.match(Zs);a.push({type:"enum",identifier:e,enumValue:n,renderParent:o})}else if(Hs.test(t)){const[,e]=t.match(Hs);o?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:o})}else if(Vs.test(t)){const[,e,n]=t.match(Vs),r=n?"method":"attribute",s=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:s,renderParent:o})}else if(Ys.test(t)&&i.length){const[,e]=t.match(Ys);a.push({type:"attribute",identifier:e,renderParent:o})}else if(Bs.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:o,nullable:e})}else{if(!Ks.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:o,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=Nt`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Sn(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Nt(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=ei(e);t&&r.push(t);break}case"attribute":r.push(ri(e));break;case"internal-slot":r.push(ti(e));break;case"method":r.push(si(e));break;case"enum":r.push(ii(e));break;case"exception":r.push(oi(e));break;case"idl-primitive":r.push(ai(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const li=new Set(["alias","reference"]),ui=async function(){const e=await Ot.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[...li]){const r=e.transaction(n,"readwrite").store,s=IDBKeyRange.lowerBound(t);let i=await r.openCursor(s);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 di={get ready(){return ui},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!li.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(!li.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),s=await n.openCursor(r);return s?s.value:s},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const s={id:r,...e[r],expires:t};s.aliasOf?n.alias.push(s):n.reference.push(s)}const r=[...li].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!li.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:s}=n.transaction(e,"readwrite");await s.delete(t.id),r=!1}}const{store:s}=n.transaction(e,"readwrite");return r?await s.put(t):await s.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...li],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},pi={},fi=new URL("https://api.specref.org/bibrefs?refs="),hi=Yt({hint:"dns-prefetch",href:fi.origin});let mi;document.head.appendChild(hi);const gi=new Promise((e=>{mi=e}));async function bi(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(fi.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const s=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 di.addAll(s,e)}catch(e){console.error(e)}return s}async function yi(e){const t=await gi;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await yi(n.aliasOf):n}var wi=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=pi;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 di.ready;const n=e.map((async e=>({id:e,data:await di.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):[],s={hasData:[],noData:[]};r.forEach((e=>{(e.data?s.hasData:s.noData).push(e)})),s.hasData.forEach((e=>{pi[e.id]=e.data}));const i=s.noData.map((e=>e.id));if(i.length){const e=await bi(i,{forceUpdate:!0});Object.assign(pi,e)}Object.assign(pi,this.conf.localBiblio),(()=>{mi(this.conf.biblio)})()}},biblio:pi,name:"core/biblio",resolveRef:yi,updateFromNetwork:bi});const vi="core/render-biblio",$i=rn({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:"参考文献"}}),ki=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"]]),xi=(_i=".",e=>{const t=e.trim();return!t||t.endsWith(_i)?t:t+_i});var _i;function Ci(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(Si)),s=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=s.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),o=Nt`<section> + >`}function ui(e){let t;try{t=function(e){const t=ti.test(e),n=t?ei:Qs,[r,s]=e.split(n);if(t&&r&&!s)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(s).filter((e=>e&&e.trim())).map((e=>e.trim())),o=!e.includes("/"),a=[];for(;i.length;){const t=i.pop();if(Ys.test(t)){const[,e,n,r,s]=t.match(Ys),i=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=s?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:i,renderParent:o,renderText:c,renderArgs:l})}else if(Xs.test(t)){const[,e,n]=t.match(Xs);a.push({type:"enum",identifier:e,enumValue:n,renderParent:o})}else if(Vs.test(t)){const[,e]=t.match(Vs);o?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:o})}else if(Ks.test(t)){const[,e,n]=t.match(Ks),r=n?"method":"attribute",s=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:s,renderParent:o})}else if(Zs.test(t)&&i.length){const[,e]=t.match(Zs);a.push({type:"attribute",identifier:e,renderParent:o})}else if(Gs.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:o,nullable:e})}else{if(!Js.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:o,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=Ot`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Rn(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Ot(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=ni(e);t&&r.push(t);break}case"attribute":r.push(ii(e));break;case"internal-slot":r.push(ri(e));break;case"method":r.push(oi(e));break;case"enum":r.push(ai(e));break;case"exception":r.push(ci(e));break;case"idl-primitive":r.push(li(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const di=new Set(["alias","reference"]),pi=async function(){const e=await jt.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[...di]){const r=e.transaction(n,"readwrite").store,s=IDBKeyRange.lowerBound(t);let i=await r.openCursor(s);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 fi={get ready(){return pi},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!di.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(!di.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),s=await n.openCursor(r);return s?s.value:s},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const s={id:r,...e[r],expires:t};s.aliasOf?n.alias.push(s):n.reference.push(s)}const r=[...di].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!di.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:s}=n.transaction(e,"readwrite");await s.delete(t.id),r=!1}}const{store:s}=n.transaction(e,"readwrite");return r?await s.put(t):await s.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...di],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},hi={},mi=new URL("https://api.specref.org/bibrefs?refs="),gi=Kt({hint:"dns-prefetch",href:mi.origin});let bi;document.head.appendChild(gi);const yi=new Promise((e=>{bi=e}));async function wi(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(mi.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const s=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 fi.addAll(s,e)}catch(e){console.error(e)}return s}async function vi(e){const t=await yi;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await vi(n.aliasOf):n}var $i=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=hi;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 fi.ready;const n=e.map((async e=>({id:e,data:await fi.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):[],s={hasData:[],noData:[]};r.forEach((e=>{(e.data?s.hasData:s.noData).push(e)})),s.hasData.forEach((e=>{hi[e.id]=e.data}));const i=s.noData.map((e=>e.id));if(i.length){const e=await wi(i,{forceUpdate:!0});Object.assign(hi,e)}Object.assign(hi,this.conf.localBiblio),(()=>{bi(this.conf.biblio)})()}},biblio:hi,name:"core/biblio",resolveRef:vi,updateFromNetwork:wi});const ki="core/render-biblio",xi=sn({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:"参考文献"}}),_i=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"]]),Ci=(Si=".",e=>{const t=e.trim();return!t||t.endsWith(Si)?t:t+Si});var Si;function Ri(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(Ei)),s=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=s.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),o=Ot`<section> <h3>${t}</h3> - <dl class="bibliography">${i.map(Ei)}</dl> - </section>`;pn(o,"",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()}`,s=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(s),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"}))}))}(s,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()));Sn(`Reference "[${t}]" not found.`,vi,{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),o}function Si(e){let t=pi[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Sn(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,vi)}else n=t.aliasOf,t=pi[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Ri(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,s=Nt`<cite + <dl class="bibliography">${i.map(Ti)}</dl> + </section>`;fn(o,"",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()}`,s=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(s),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"}))}))}(s,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()));Rn(`Reference "[${t}]" not found.`,ki,{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),o}function Ei(e){let t=hi[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Rn(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,ki)}else n=t.aliasOf,t=hi[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Ai(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,s=Ot`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?s:Nt`[${s}]`}function Ei(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Nt` + >`;return t?s:Ot`[${s}]`}function Ti(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Ot` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:Ai(n)}:Nt`<em class="respec-offending-element" - >${$i.reference_not_found}</em + ${n?{html:Li(n)}:Ot`<em class="respec-offending-element" + >${xi.reference_not_found}</em >`} </dd> - `}function Ai(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} ${xi(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${ki.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Ti=Object.freeze({__proto__:null,name:vi,renderInlineCitation:Ri,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")||Nt`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Nt`<h1>${$i.references}</h1>`),r.classList.add("appendix"),n.length){const e=Ci(n,$i.norm_references);r.appendChild(e)}if(t.length){const e=Ci(t,$i.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Li="core/inlines",Pi={},Ii=e=>new RegExp(e.map((e=>e.source)).join("|")),Di=rn({en:{rfc2119Keywords:()=>Ii([/\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:()=>Ii([/\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/])}}),Ni=/(?:`[^`]+`)(?!`)/,Oi=/(?:{{[^}]+\?*}})/,ji=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Mi=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,zi=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Ui=/(?:\[=[^=]+=\])/,qi=/(?:\[\^[^^]+\^\])/;function Wi(e){const t=e.slice(2,-2).trim(),[n,r,s]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,o,a]=t.startsWith("/")?["element-attr",null,n]:s?["attr-value",`${n}/${r}`,s]:r?["element-attr",n,r]:["element",null,n];return Nt`<code + `}function Li(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} ${Ci(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${_i.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Pi=Object.freeze({__proto__:null,name:ki,renderInlineCitation:Ai,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")||Ot`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Ot`<h1>${xi.references}</h1>`),r.classList.add("appendix"),n.length){const e=Ri(n,xi.norm_references);r.appendChild(e)}if(t.length){const e=Ri(t,xi.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Ii="core/inlines",Di={},Ni=e=>new RegExp(e.map((e=>e.source)).join("|")),Oi=sn({en:{rfc2119Keywords:()=>Ni([/\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:()=>Ni([/\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/])}}),ji=/(?:`[^`]+`)(?!`)/,Mi=/(?:{{[^}]+\?*}})/,zi=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Ui=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,qi=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Wi=/(?:\[=[^=]+=\])/,Fi=/(?:\[\^[^^]+\^\])/;function Bi(e){const t=e.slice(2,-2).trim(),[n,r,s]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,o,a]=t.startsWith("/")?["element-attr",null,n]:s?["attr-value",`${n}/${r}`,s]:r?["element-attr",n,r]:["element",null,n];return Ot`<code ><a data-xref-type="${i}" data-xref-for="${o}" @@ -819,47 +821,47 @@ dd{margin-left:0} data-link-for="${o}" >${a}</a ></code - >`}function Fi(e){const t=nn(e),n=Nt`<em class="rfc2119">${t}</em>`;return Pi[t]=!0,n}function Bi(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Nt`<a href="${t}" data-matched-text="${e}"></a>`:Nt`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Hi(e,t){const n=nn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=ci(n);return!!t.parentElement.closest("dfn")?Zi(`\`${r.textContent}\``):r}function Gi(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,i]=r.split("|").map(nn),{type:o,illegal:a}=mn(s,t.parentElement),c=Ri(s,i),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Rn("Normative references in informative sections are not allowed. ",Li,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==o||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function Vi(e,t,n){return"ABBR"===t.parentElement.tagName?e:Nt`<abbr title="${n.get(e)}">${e}</abbr>`}function Yi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Nt`<var data-type="${r}">${n}</var>`}function Ki(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(nn).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),i=n.substring(r+1,n.length);return[t(s),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,i]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],o=Ji(i),a=n?nn(n):null;return Nt`<a + >`}function Hi(e){const t=rn(e),n=Ot`<em class="rfc2119">${t}</em>`;return Di[t]=!0,n}function Gi(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Ot`<a href="${t}" data-matched-text="${e}"></a>`:Ot`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Vi(e,t){const n=rn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=ui(n);return!!t.parentElement.closest("dfn")?Xi(`\`${r.textContent}\``):r}function Yi(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,i]=r.split("|").map(rn),{type:o,illegal:a}=gn(s,t.parentElement),c=Ai(s,i),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;En("Normative references in informative sections are not allowed. ",Ii,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==o||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function Ki(e,t,n){return"ABBR"===t.parentElement.tagName?e:Ot`<abbr title="${n.get(e)}">${e}</abbr>`}function Zi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Ot`<var data-type="${r}">${n}</var>`}function Ji(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(rn).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),i=n.substring(r+1,n.length);return[t(s),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,i]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],o=Qi(i),a=n?rn(n):null;return Ot`<a data-link-type="dfn" data-link-for="${a}" data-xref-for="${a}" data-lt="${s}" >${o}</a - >`}function Zi(e){const t=e.slice(1,-1);return Nt`<code>${t}</code>`}function Ji(e){return Ni.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Zi(e):Ji(e))):document.createTextNode(e)}var Xi=Object.freeze({__proto__:null,name:Li,rfc2119Usage:Pi,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new vn,e.informativeReferences=new vn,e.respecRFC2119||(e.respecRFC2119=Pi);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=nn(e),s=nn(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=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 o;for(;o=s.nextNode();)i.push(o);return i}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),i=Di.rfc2119Keywords(),o=new RegExp(`(${Ii([i,Oi,ji,Mi,zi,Ui,Ni,qi,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(o);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const o of r)if(a=!a,a)switch(!0){case o.startsWith("{{"):s.append(Hi(o,n));break;case o.startsWith("[[["):s.append(Bi(o));break;case o.startsWith("[["):s.append(...Gi(o,n,e));break;case o.startsWith("|"):s.append(Yi(o));break;case o.startsWith("[="):s.append(Ki(o));break;case o.startsWith("`"):s.append(Zi(o));break;case o.startsWith("[^"):s.append(Wi(o));break;case t.has(o):s.append(Vi(o,n,t));break;case i.test(o):s.append(Fi(o))}else s.append(o);n.replaceWith(s)}}});const Qi="w3c/conformance",eo=rn({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)=>Nt`<p> + >`}function Xi(e){const t=e.slice(1,-1);return Ot`<code>${t}</code>`}function Qi(e){return ji.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Xi(e):Qi(e))):document.createTextNode(e)}var eo=Object.freeze({__proto__:null,name:Ii,rfc2119Usage:Di,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new $n,e.informativeReferences=new $n,e.respecRFC2119||(e.respecRFC2119=Di);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=rn(e),s=rn(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=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 o;for(;o=s.nextNode();)i.push(o);return i}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),i=Oi.rfc2119Keywords(),o=new RegExp(`(${Ni([i,Mi,zi,Ui,qi,Wi,ji,Fi,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(o);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const o of r)if(a=!a,a)switch(!0){case o.startsWith("{{"):s.append(Vi(o,n));break;case o.startsWith("[[["):s.append(Gi(o));break;case o.startsWith("[["):s.append(...Yi(o,n,e));break;case o.startsWith("|"):s.append(Zi(o));break;case o.startsWith("[="):s.append(Ji(o));break;case o.startsWith("`"):s.append(Xi(o));break;case o.startsWith("[^"):s.append(Bi(o));break;case t.has(o):s.append(Ki(o,n,t));break;case i.test(o):s.append(Hi(o))}else s.append(o);n.replaceWith(s)}}});const to="w3c/conformance",no=sn({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)=>Ot`<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> - ${Ri("RFC2119")} ${Ri("RFC8174")} + ${Ai("RFC2119")} ${Ai("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)=>Nt`<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)=>Ot`<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> - ${Ri("RFC2119")} ${Ri("RFC8174")} + ${Ai("RFC2119")} ${Ai("RFC8174")} und unter Berücksichtigung von <a href="https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst" >2119de</a > zu interpretieren, wenn und nur wenn ${t?"sie":"es"} wie hier gezeigt durchgehend groß geschrieben wurde${t?"n":""}. - </p>`}});var to=Object.freeze({__proto__:null,name:Qi,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&function(e,t){const n=[...Object.keys(Pi)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=un(n.sort(),(e=>Nt`<em class="rfc2119">${e}</em>`)),s=n.length>1,i=Nt` - <h1>${eo.conformance}</h1> - <p>${eo.normativity}</p> - ${n.length?eo.keywordInterpretation(r,s):null} - `;e.prepend(...i.childNodes)}(t,e),!t&&Object.keys(Pi).length){Rn("Document uses RFC2119 keywords but lacks a conformance section.",Qi,{hint:'Please add a `<section id="conformance">`.'})}}});function no(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){Sn(`Invalid ${t} name "${e}": ${s.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function ro(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Sn(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const so=new _n;function io(e,t){for(const n of t)so.has(n)||so.set(n,new Set),so.get(n).add(e)}const oo="core/dfn",ao=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:ro}],["element",{requiresFor:!1,validator:no}],["element-attr",{requiresFor:!1,validator:no}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:ro}],["event",{requiresFor:!1,validator:ro}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new Mt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return Sn(`Invalid ${t} "${e}": ${s.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:ro}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?ro(e.slice(1,-1),t,n,r):(Sn(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),co=[...ao.keys()];function lo(e,t){let n="";switch(!0){case co.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>ao.has(e))),function(e,t,n){const r=ao.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=Pn`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,i=Pn`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;Sn(e,oo,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,oo)}(t,n,e);break;case Vs.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=Pn`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Sn(`Internal slot "${e}" must be associated with a WebIDL interface.`,oo,{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 s=["attribute","method"],{dfnType:i}=t.dataset;if(!s.includes(i)||r!==i){const n=Pn`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${An(s,{quotes:!0})}. The slot "${e}" seems to be a "${En(r)}"?`;return Sn(n,oo,{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 uo(e){switch(!0){case e.matches(".export.no-export"):Sn(Pn`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,oo,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Sn(Pn`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,oo,{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 po(){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 fo=Object.freeze({__proto__:null,name:oo,run:function(){for(const e of document.querySelectorAll("dfn")){const t=fn(e);if(io(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;lo(e,n),uo(e),1===t.length&&n===nn(e.textContent)||(e.dataset.lt=t.join("|"))}s("plugins-done",po)}});var ho=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=nn(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=nn(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=nn(n).toLowerCase(),s=zt.isSingular(r)?zt.plural(r):zt.singular(r);return e.has(s)&&!t.has(s)?s:""}}();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("|"),io(e,n)}}))}});var mo=String.raw`span.example-title{text-transform:none} + </p>`}});var ro=Object.freeze({__proto__:null,name:to,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&function(e,t){const n=[...Object.keys(Di)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=dn(n.sort(),(e=>Ot`<em class="rfc2119">${e}</em>`)),s=n.length>1,i=Ot` + <h1>${no.conformance}</h1> + <p>${no.normativity}</p> + ${n.length?no.keywordInterpretation(r,s):null} + `;e.prepend(...i.childNodes)}(t,e),!t&&Object.keys(Di).length){En("Document uses RFC2119 keywords but lacks a conformance section.",to,{hint:'Please add a `<section id="conformance">`.'})}}});function so(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){Rn(`Invalid ${t} name "${e}": ${s.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function io(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Rn(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const oo=new Cn;function ao(e,t){for(const n of t)oo.has(n)||oo.set(n,new Set),oo.get(n).add(e)}const co="core/dfn",lo=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:io}],["element",{requiresFor:!1,validator:so}],["element-attr",{requiresFor:!1,validator:so}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:io}],["event",{requiresFor:!1,validator:io}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new zt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return Rn(`Invalid ${t} "${e}": ${s.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:io}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?io(e.slice(1,-1),t,n,r):(Rn(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),uo=[...lo.keys()];function po(e,t){let n="";switch(!0){case uo.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>lo.has(e))),function(e,t,n){const r=lo.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=In`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,i=In`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;Rn(e,co,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,co)}(t,n,e);break;case Ks.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=In`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Rn(`Internal slot "${e}" must be associated with a WebIDL interface.`,co,{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 s=["attribute","method"],{dfnType:i}=t.dataset;if(!s.includes(i)||r!==i){const n=In`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${Tn(s,{quotes:!0})}. The slot "${e}" seems to be a "${An(r)}"?`;return Rn(n,co,{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 fo(e){switch(!0){case e.matches(".export.no-export"):Rn(In`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,co,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Rn(In`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,co,{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 ho(){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 mo=Object.freeze({__proto__:null,name:co,run:function(){for(const e of document.querySelectorAll("dfn")){const t=hn(e);if(ao(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;po(e,n),fo(e),1===t.length&&n===rn(e.textContent)||(e.dataset.lt=t.join("|"))}s("plugins-done",ho)}});var go=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=rn(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=rn(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=rn(n).toLowerCase(),s=Ut.isSingular(r)?Ut.plural(r):Ut.singular(r);return e.has(s)&&!t.has(s)?s:""}}();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("|"),ao(e,n)}}))}});var bo=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 go=rn({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function bo(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",s=n.title?Nt`<span class="example-title">: ${n.title}</span>`:"";return Nt`<div class="marker"> - <a class="self-link">${go.example}<bdi>${r}</bdi></a +.example pre{background-color:rgba(0,0,0,.03)}`;const yo=sn({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function wo(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",s=n.title?Ot`<span class="example-title">: ${n.title}</span>`:"";return Ot`<div class="marker"> + <a class="self-link">${yo.example}<bdi>${r}</bdi></a >${s} - </div>`}var yo=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(Nt`<style> - ${mo} - </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:s}=e;if("aside"===e.localName){++t;const n=bo(e,t,r);e.prepend(n);const i=pn(e,"example",s||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 o=bo(e,n?0:t,r),a=Nt`<div class="example" id="${i}"> + </div>`}var vo=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(Ot`<style> + ${bo} + </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:s}=e;if("aside"===e.localName){++t;const n=wo(e,t,r);e.prepend(n);const i=fn(e,"example",s||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 o=wo(e,n?0:t,r),a=Ot`<div class="example" id="${i}"> ${o} ${e.cloneNode(!0)} - </div>`;pn(a,"example",s||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var wo=String.raw`.issue-label{text-transform:initial} + </div>`;fn(a,"example",s||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var $o=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} @@ -869,31 +871,31 @@ 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 vo="core/issues-notes",$o=rn({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 ko(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}}(),s=document.createElement("ul");e.forEach((e=>{const{type:i,displayType:o,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),s=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",o=t?s?$o.feature_at_risk:$o.issue:n?$o.warning:r?$o.editors_note:$o.note;return{type:i,displayType:o,isFeatureAtRisk:s}}(e),c="issue"===i,l="span"===e.localName,{number:u}=e.dataset,d={type:i,inline:l,title:e.title,number:r(e)};if(!l){const r=Nt`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,l=document.createElement("span"),p=Nt`<div role="heading" class="${`${i}-title marker`}">${l}</div>`;pn(p,"h",i);let f,h=o;if(e.id?(r.id=e.id,e.removeAttribute("id")):pn(r,"issue-container",d.number?`number-${d.number}`:""),c){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 Nt`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Nt`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){Rn(`Failed to fetch issue number ${u}.`,vo)}f&&!d.title&&(d.title=f.title)}s.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,s=t.title?Nt`<span style="text-transform: none">: ${t.title}</span>`:"";return Nt`<li><a href="${`#${n}`}">${r}</a>${s}</li>`}($o.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},s=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,s=new URL("./issues/",t);s.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)],[s,i,o]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*s+.7152*i+.0722*o>.179?"#000":"#fff"}(n),o=`GitHub label: ${r}`;return Nt` <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 ko="core/issues-notes",xo=sn({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 _o(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}}(),s=document.createElement("ul");e.forEach((e=>{const{type:i,displayType:o,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),s=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",o=t?s?xo.feature_at_risk:xo.issue:n?xo.warning:r?xo.editors_note:xo.note;return{type:i,displayType:o,isFeatureAtRisk:s}}(e),c="issue"===i,l="span"===e.localName,{number:u}=e.dataset,d={type:i,inline:l,title:e.title,number:r(e)};if(!l){const r=Ot`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,l=document.createElement("span"),p=Ot`<div role="heading" class="${`${i}-title marker`}">${l}</div>`;fn(p,"h",i);let f,h=o;if(e.id?(r.id=e.id,e.removeAttribute("id")):fn(r,"issue-container",d.number?`number-${d.number}`:""),c){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 Ot`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Ot`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){En(`Failed to fetch issue number ${u}.`,ko)}f&&!d.title&&(d.title=f.title)}s.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,s=t.title?Ot`<span style="text-transform: none">: ${t.title}</span>`:"";return Ot`<li><a href="${`#${n}`}">${r}</a>${s}</li>`}(xo.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},s=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,s=new URL("./issues/",t);s.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)],[s,i,o]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*s+.7152*i+.0722*o>.179?"#000":"#fff"}(n),o=`GitHub label: ${r}`;return Ot` <a class="respec-gh-label" style="${`background-color: #${n}; color: ${i}`}" href="${s.href}" aria-label="${o}" >${r}</a - >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Nt`<span class="issue-label">: ${t}${r}</span>`}(s,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=yn(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(Nt`<p>${$o.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${$o.issue_summary}</h1>`)}(s)}var xo=Object.freeze({__proto__:null,name:vo,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 Sn(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,vo),new Map;const s=await r.json();return new Map(Object.entries(s))}(e.github),{head:s}=document;s.insertBefore(Nt`<style> - ${wo} - </style>`,s.querySelector("link")),ko(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const _o="core/best-practices",Co={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},So=rn(Co),Ro=c in Co?c:"en";var Eo=Object.freeze({__proto__:null,name:_o,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=pn(e,"bp"),s=Nt`<a class="marker self-link" href="${`#${r}`}" - ><bdi lang="${Ro}">${So.best_practice}${t+1}</bdi></a - >`;if(n){const t=Nt`<li>${s}: ${$n(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const o=Nt`${s.cloneNode(!0)}: ${e}`;i.prepend(...o.childNodes)})),e.length)t&&(t.appendChild(Nt`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Rn("Using best practices summary (#bp-summary) but no best practices found.",_o),t.remove()}}});const Ao="core/figures",To=rn({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 Lo=Object.freeze({__proto__:null,name:Ao,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||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;pn(e,"fig",r),gn(t,Nt`<span class="fig-title"></span>`),t.prepend(Nt`<a class="self-link" href="#${e.id}" - >${To.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=>{hn(e,"span").removeAttribute("href")})),Nt`<li class="tofline"> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Ot`<span class="issue-label">: ${t}${r}</span>`}(s,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=wn(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(Ot`<p>${xo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${xo.issue_summary}</h1>`)}(s)}var Co=Object.freeze({__proto__:null,name:ko,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 Rn(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ko),new Map;const s=await r.json();return new Map(Object.entries(s))}(e.github),{head:s}=document;s.insertBefore(Ot`<style> + ${$o} + </style>`,s.querySelector("link")),_o(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const So="core/best-practices",Ro={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Eo=sn(Ro),Ao=c in Ro?c:"en";var To=Object.freeze({__proto__:null,name:So,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=fn(e,"bp"),s=Ot`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${Ao}">${Eo.best_practice}${t+1}</bdi></a + >`;if(n){const t=Ot`<li>${s}: ${kn(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const o=Ot`${s.cloneNode(!0)}: ${e}`;i.prepend(...o.childNodes)})),e.length)t&&(t.appendChild(Ot`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){En("Using best practices summary (#bp-summary) but no best practices found.",So),t.remove()}}});const Lo="core/figures",Po=sn({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 Io=Object.freeze({__proto__:null,name:Lo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||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;fn(e,"fig",r),bn(t,Ot`<span class="fig-title"></span>`),t.prepend(Ot`<a class="self-link" href="#${e.id}" + >${Po.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=>{mn(e,"span").removeAttribute("href")})),Ot`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> - </li>`}(t.id,r));else{Rn("Found a `<figure>` without a `<figcaption>`.",Ao,{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=bn(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(Nt`<h1>${To.list_of_figures}</h1>`,Nt`<ul class="tof"> + </li>`}(t.id,r));else{En("Found a `<figure>` without a `<figcaption>`.",Lo,{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=yn(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(Ot`<h1>${Po.list_of_figures}</h1>`,Ot`<ul class="tof"> ${e} - </ul>`))}});const Po=rn({en:{list_of_tables:"List of Tables",table:"Table "}});var Io=Object.freeze({__proto__:null,name:"core/tables",run:function(){const e=function(){const e=[];return[...document.querySelectorAll("table.numbered")].filter((e=>!!e.querySelector("caption"))).forEach(((t,n)=>{const r=t.querySelector("caption");!function(e,t,n){const r=t.textContent;pn(e,"table",r),gn(t,Nt`<span class="table-title"></span>`),t.prepend(Nt`<a class="self-link" href="#${e.id}" - >${Po.table}<bdi class="tableno">${n+1}</bdi></a - >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);for(const e of n.querySelectorAll("a"))hn(e,"span",{copyAttributes:!1});return Nt`<li> + </ul>`))}});const Do=sn({en:{list_of_tables:"List of Tables",table:"Table "}});var No=Object.freeze({__proto__:null,name:"core/tables",run:function(){const e=function(){const e=[];return[...document.querySelectorAll("table.numbered")].filter((e=>!!e.querySelector("caption"))).forEach(((t,n)=>{const r=t.querySelector("caption");!function(e,t,n){const r=t.textContent;fn(e,"table",r),bn(t,Ot`<span class="table-title"></span>`),t.prepend(Ot`<a class="self-link" href="#${e.id}" + >${Do.table}<bdi class="tableno">${n+1}</bdi></a + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);for(const e of n.querySelectorAll("a"))mn(e,"span",{copyAttributes:!1});return Ot`<li> <a class="tocxref" href="${`#${e}`}" >${n.childNodes}</a > - </li>`}(t.id,r))})),e}(),t=document.querySelector("section#list-of-tables");e.length&&t&&(!function(e){if(e.matches(".appendix, .introductory")||e.closest("section"))return;const t=bn(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(Nt`<h1>${Po.list_of_tables}</h1>`,Nt`<ul class="list-of-tables"> + </li>`}(t.id,r))})),e}(),t=document.querySelector("section#list-of-tables");e.length&&t&&(!function(e){if(e.matches(".appendix, .introductory")||e.closest("section"))return;const t=yn(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(Ot`<h1>${Do.list_of_tables}</h1>`,Ot`<ul class="list-of-tables"> ${e} - </ul>`))}});const Do=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function No(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return Oo(e,t,n);return Oo(e,t,`${n}()`,n)}(e,n,t);default:return Oo(e,n,t)}}function Oo(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=Mo(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=so.get(n);e&&1===e.size&&(s=[...e],io(s[0],[n]))}else n=e;if(s.length>1){Sn(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function jo(e,t,n,r){if(!e.id){const t=n.toLowerCase(),s=t?`${t}-`:"";let i=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===i&&(i="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${s}${i}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=zo(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||gn(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":!function(e,t){const{local:n,exportable:r}=t,s=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)s.add(e);n.filter((e=>s.has(e))).forEach((e=>s.delete(e))),e.dataset.lt=[...s].join("|"),e.dataset.localLt=n.join("|"),io(e,[...n,...r])}(e,function(e,t,n){const{type:r}=e,s=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${s}()`,i=function(e,t){const n=[];if(0===t.length)return n;const r=[],s=[];for(const{name:e,optional:n,variadic:i}of t)n||i?s.push(e):r.push(e);const i=r.join(", "),o=`${e}(${i})`;n.push(o);const a=s.map(((t,n)=>{const i=[...r,...s.slice(0,n+1)].join(", ");return`${e}(${i})`}));return n.push(...a),n}(n,e.arguments);return{local:[s,r,n],exportable:[t,...i]}}case"attribute":return{local:[s],exportable:[n]}}}(t,n,r))}return e}function Mo(e,t,n,r){const s=so.get(e);if(!s||0===s.size)return[];const i=[...s],o=i.filter((e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t}));if(0===o.length&&""===t&&1===i.length)return i[0].textContent===n?i:[];if(Do.has(r)&&i.length){const e=i.find((e=>e.textContent.trim()===n));if(e)return[e]}return o}function zo(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(zo).join("|"):zo(t))}const Uo=function(){const e=document.createElement("button");return e.innerHTML='<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>',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function qo(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=Uo.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var Wo=Object.freeze({__proto__:null,addCopyIDLButton:qo,name:"core/webidl-clipboard"});var Fo=String.raw`pre.idl{padding:1em;position:relative} + </ul>`))}});const Oo=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function jo(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return Mo(e,t,n);return Mo(e,t,`${n}()`,n)}(e,n,t);default:return Mo(e,n,t)}}function Mo(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=Uo(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=oo.get(n);e&&1===e.size&&(s=[...e],ao(s[0],[n]))}else n=e;if(s.length>1){Rn(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function zo(e,t,n,r){if(!e.id){const t=n.toLowerCase(),s=t?`${t}-`:"";let i=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===i&&(i="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${s}${i}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=qo(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||bn(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":!function(e,t){const{local:n,exportable:r}=t,s=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)s.add(e);n.filter((e=>s.has(e))).forEach((e=>s.delete(e))),e.dataset.lt=[...s].join("|"),e.dataset.localLt=n.join("|"),ao(e,[...n,...r])}(e,function(e,t,n){const{type:r}=e,s=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${s}()`,i=function(e,t){const n=[];if(0===t.length)return n;const r=[],s=[];for(const{name:e,optional:n,variadic:i}of t)n||i?s.push(e):r.push(e);const i=r.join(", "),o=`${e}(${i})`;n.push(o);const a=s.map(((t,n)=>{const i=[...r,...s.slice(0,n+1)].join(", ");return`${e}(${i})`}));return n.push(...a),n}(n,e.arguments);return{local:[s,r,n],exportable:[t,...i]}}case"attribute":return{local:[s],exportable:[n]}}}(t,n,r))}return e}function Uo(e,t,n,r){const s=oo.get(e);if(!s||0===s.size)return[];const i=[...s],o=i.filter((e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t}));if(0===o.length&&""===t&&1===i.length)return i[0].textContent===n?i:[];if(Oo.has(r)&&i.length){const e=i.find((e=>e.textContent.trim()===n));if(e)return[e]}return o}function qo(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(qo).join("|"):qo(t))}const Wo=function(){const e=document.createElement("button");return e.innerHTML='<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>',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function Fo(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=Wo.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var Bo=Object.freeze({__proto__:null,addCopyIDLButton:Fo,name:"core/webidl-clipboard"});var Ho=String.raw`pre.idl{padding:1em;position:relative} pre.idl>code{color:#000} @media print{ pre.idl{white-space:pre-wrap} @@ -918,37 +920,37 @@ a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none} .respec-button-copy-paste:is(:disabled,:disabled:hover,.disabled,.disabled:hover){color:rgba(102,102,102,.5);cursor:default;background-color:rgba(229,229,229,.5);background-image:none;border-color:rgba(197,197,197,.5);box-shadow:none} @media print{ .respec-button-copy-paste{visibility:hidden} -}`;const Bo="core/webidl",Ho=Bo,Go={},Vo={},Yo={wrap:e=>e.flat().filter((e=>""!==e)).map((e=>"string"==typeof e?new Text(e):e)),trivia:e=>e.trim()?Nt`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?Nt`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:Nt`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",s=null;if("object"===t)r="interface",s="WEBIDL";return Nt`<a +}`;const Go="core/webidl",Vo=Go,Yo={},Ko={},Zo={wrap:e=>e.flat().filter((e=>""!==e)).map((e=>"string"==typeof e?new Text(e):e)),trivia:e=>e.trim()?Ot`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?Ot`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:Ot`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",s=null;if("object"===t)r="interface",s="WEBIDL";return Ot`<a data-link-type="${"_IDL_"===r?"idl":r}" data-xref-type="${r}" data-cite="${s}" data-lt="${undefined}" >${e}</a - >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return Nt`<span class="idlParamName">${e}</span>`;const r=Ko(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"operation":case"constructor":return Ko(e,t,n);default:return e}},type:e=>Nt`<span class="idlType">${e}</span>`,inheritance:e=>Nt`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=function(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}(t);switch(t.type){case"includes":case"enum-value":return Nt`<span class="${r}">${e}</span>`}const s=n?n.name:"",{name:i,idlId:o}=Jo(t,s);return Nt`<span + >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return Ot`<span class="idlParamName">${e}</span>`;const r=Jo(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"operation":case"constructor":return Jo(e,t,n);default:return e}},type:e=>Ot`<span class="idlType">${e}</span>`,inheritance:e=>Ot`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=function(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}(t);switch(t.type){case"includes":case"enum-value":return Ot`<span class="${r}">${e}</span>`}const s=n?n.name:"",{name:i,idlId:o}=Qo(t,s);return Ot`<span class="${r}" id="${o}" data-idl data-title="${i}" >${e}</span - >`},extendedAttribute:e=>Nt`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>Nt`<a data-xref-type="extended-attribute">${e}</a>`};function Ko(e,t,n){const r=n?n.name:"",{name:s}=Jo(t,r),i=No(t,s,{parent:r}),o=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(i){t.partial||(i.matches("[data-noexport]")||(i.dataset.export=""),i.dataset.dfnType=o),jo(i,t,r,s);const n=`#${i.id}`;return Nt`<a + >`},extendedAttribute:e=>Ot`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>Ot`<a data-xref-type="extended-attribute">${e}</a>`};function Jo(e,t,n){const r=n?n.name:"",{name:s}=Qo(t,r),i=jo(t,s,{parent:r}),o=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(i){t.partial||(i.matches("[data-noexport]")||(i.dataset.export=""),i.dataset.dfnType=o),zo(i,t,r,s);const n=`#${i.id}`;return Ot`<a data-link-for="${r}" data-link-type="${o}" href="${n}" class="internalDFN" ><code>${e}</code></a - >`}const a="operation"===t.type&&"toJSON"===t.name&&t.extAttrs.some((({name:e})=>"Default"===e));if(a)return Nt`<a data-link-type="dfn" data-lt="default toJSON steps" + >`}const a="operation"===t.type&&"toJSON"===t.name&&t.extAttrs.some((({name:e})=>"Default"===e));if(a)return Ot`<a data-link-type="dfn" data-lt="default toJSON steps" >${e}</a - >`;if(!t.partial){const n=Nt`<dfn data-export data-dfn-type="${o}" + >`;if(!t.partial){const n=Ot`<dfn data-export data-dfn-type="${o}" >${e}</dfn - >`;return io(n,[s]),jo(n,t,r,s),n}const c=Nt`<a + >`;return ao(n,[s]),zo(n,t,r,s),n}const c=Ot`<a data-idl="${t.partial?"partial":null}" data-link-type="${o}" data-title="${t.name}" data-xref-type="${o}" >${e}</a - >`;if(s&&"typedef"!==t.type&&!(t.partial&&!i)){const e=Pn`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;Rn(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,Ho,{elements:[c],hint:e})}return c}const Zo=new WeakMap;function Jo(e,t=""){if(Zo.has(e))return Zo.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);let r=function(e,t){if(!t)return`idl-def-${e.toLowerCase()}`;return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}((e.special&&""===e.name?"anonymous-":"")+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":r+=function(e){if(!e.partial)return"";Vo[e.name]||(Vo[e.name]=0);return Vo[e.name]+=1,`-partial-${Vo[e.name]}`}(e);break;case"constructor":case"operation":{const s=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;Go[r]||(Go[r]=0);Go[n]?s=`!overload-${Go[n]}`:Go[n]=0;return Go[r]+=1,Go[n]+=1,s||""}(n,t);s?(n+=s,r+=s):e.arguments.length&&(r+=e.arguments.map((e=>`-${e.name.toLowerCase()}`)).join(""));break}}return{name:n,idlId:r}}(e,t);return Zo.set(e,n),n}const Xo=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Qo(e,t){let n;try{n=Ut.parse(e.textContent,{sourceName:String(t)})}catch(t){return Sn(`Failed to parse WebIDL: ${t.bareMessage}.`,Ho,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=Ut.write(n,{templates:Yo});Nt.bind(e)`${r}`,gn(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach((e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Xo.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&io(e,[t])}));const s=e.closest("[data-cite], body"),{dataset:i}=s;if(i.cite||(i.cite="WEBIDL"),!/\bwebidl\b/i.test(i.cite)){const e=i.cite.trim().split(/\s+/);i.cite=["WEBIDL",...e].join(" ")}return ea(e),n}function ea(e){dn(e,"webidl");const t=Nt`<span class="idlHeader" + >`;if(s&&"typedef"!==t.type&&!(t.partial&&!i)){const e=In`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;En(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,Vo,{elements:[c],hint:e})}return c}const Xo=new WeakMap;function Qo(e,t=""){if(Xo.has(e))return Xo.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);let r=function(e,t){if(!t)return`idl-def-${e.toLowerCase()}`;return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}((e.special&&""===e.name?"anonymous-":"")+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":r+=function(e){if(!e.partial)return"";Ko[e.name]||(Ko[e.name]=0);return Ko[e.name]+=1,`-partial-${Ko[e.name]}`}(e);break;case"constructor":case"operation":{const s=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;Yo[r]||(Yo[r]=0);Yo[n]?s=`!overload-${Yo[n]}`:Yo[n]=0;return Yo[r]+=1,Yo[n]+=1,s||""}(n,t);s?(n+=s,r+=s):e.arguments.length&&(r+=e.arguments.map((e=>`-${e.name.toLowerCase()}`)).join(""));break}}return{name:n,idlId:r}}(e,t);return Xo.set(e,n),n}const ea=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function ta(e,t){let n;try{n=qt.parse(e.textContent,{sourceName:String(t)})}catch(t){return Rn(`Failed to parse WebIDL: ${t.bareMessage}.`,Vo,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=qt.write(n,{templates:Zo});Ot.bind(e)`${r}`,bn(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach((e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!ea.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&ao(e,[t])}));const s=e.closest("[data-cite], body"),{dataset:i}=s;if(i.cite||(i.cite="WEBIDL"),!/\bwebidl\b/i.test(i.cite)){const e=i.cite.trim().split(/\s+/);i.cite=["WEBIDL",...e].join(" ")}return na(e),n}function na(e){pn(e,"webidl");const t=Ot`<span class="idlHeader" ><a class="self-link" href="${`#${e.id}`}">WebIDL</a></span - >`;e.prepend(t),qo(t)}var ta=Object.freeze({__proto__:null,addIDLHeader:ea,name:Bo,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=Fo,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Qo),r=Ut.validate(n);for(const t of r){let r=`<pre>${tn(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${tn(Ut.write(n[t.sourceName]))}</pre>`}Sn(`WebIDL validation error: ${t.bareMessage}`,Ho,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const na="core/data-cite",ra="__SPEC__";async function sa(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===ra)i=document.location.href;else{const e=await yi(t);if(!e)return null;i=e.href,o=e.title}if(s)i=s;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:o}}function ia(e,t,n){const{href:r,title:s}=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=s),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?gn(e,t):(t.textContent=s,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Sn("Exporting an linked external definition is not allowed.",na,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function oa(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const aa=oa("#"),ca=oa("/");function la(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:i}=r?la(r):{key:ra,isNormative:!1};return t.cite=i?s:`?${s}`,t.citeFrag=n.replace("#",""),la(e)}const o=r?`#${r}`:aa(n),a=s||ca(n).split("#")[0],{type:c}=mn(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:o,path:a,href:i}}function ua(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 da=Object.freeze({__proto__:null,THIS_SPEC:ra,name:na,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(la).map((async e=>({entry:e,result:await yi(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await bi(n);r&&Object.assign(pi,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=la(t),r=await sa(n);if(r)ia(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Rn(n,na,{elements:[t]})}}s("beforesave",ua)},toCiteDetails:la});const pa="core/link-to-dfn",fa=[],ha={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:"在文档中有重复的定义。"}},ma=rn(ha);function ga(e){const t=new Map,n=[];for(const r of so.get(e)){const{dfnType:s="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const o of i){if(t.has(o)&&t.get(o).has(s)){const e=t.get(o).get(s),i="dfn"===e.localName,a="dfn"===r.localName,c=s===(e.dataset.dfnType||"dfn"),l=!o&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(o);if(i&&a&&c&&l){n.push(r);continue}}t.has(o)||t.set(o,new Map),t.get(o).set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(o).set("idl",r),pn(r,"dfn",e)}}return{result:t,duplicates:n}}function ba(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=fn(e).reduce(((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[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 s=t.get(r.title).get(r.for),{linkType:i}=e.dataset;if(i)return s.get(i)||s.get("dfn");{const e=r.for?"idl":"dfn";return s.get(e)||s.get("idl")}}function ya(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&i&&!i.split(",").map((e=>e.trim())).includes(s))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"),s=wa(e)&&wa(t,n);r&&!s||gn(e,document.createElement("code"))}(e,t),!r}function wa(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 va(e){e.forEach((e=>{Rn(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,pa,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var $a=Object.freeze({__proto__:null,name:pa,possibleExternalLinks:fa,run:async function(e){const t=function(){const e=new _n;for(const t of so.keys()){const{result:n,duplicates:r}=ga(t);e.set(t,n),r.length>0&&Sn(ma.duplicateMsg(t),pa,{title:ma.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){fa.push(e);continue}const r=ba(e,t);if(r){ya(e,r,t)||fa.push(e)}else""===e.dataset.cite?n.push(e):fa.push(e)}va(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:s}=la(t);r!==ra&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||va(fa)}});const ka="xrefs",xa=3e5;async function _a(){return await Ot.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(ka,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Ca(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<xa)return!1;const r=new URL("meta/version",Ea).href,s=await fetch(r);if(!s.ok)return!1;const i=await s.text();return localStorage.setItem(e,n.toString()),parseInt(i,10)>t}())return await async function(){try{await _a().then((e=>e.clear(ka)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await _a();let r=await e.transaction(ka).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const Sa="core/xref",Ra={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},Ea="https://respec.org/xref/",Aa=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Yt({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Ta(e){const t="xrefType"in e.dataset;let n=La(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter((e=>e));if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map((e=>e.textContent.toLowerCase()));r.length&&t.push(r)}return function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter((t=>!e.includes(t)));t.push(r.sort())}return t}(t)}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return nn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return nn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function La(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=nn(n),"the-empty-string"===n?"":n}function Pa(e,t,n,r){const{term:s,specs:i=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=i.flat().includes(c)?c:a,f=new URL(o,"https://partial"),{pathname:h}=f,m={cite:p,citePath:h,citeFrag:f.hash.slice(1),type:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){if(!function(e){const t=e.closest(".normative"),n=e.closest(Vt);return!n||e===t||t&&n&&n.contains(t)}(e))return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}Aa.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Ia(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Da)}function Da(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Na(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach((e=>{n.forEach((t=>e.removeAttribute(t)))}))}var Oa=Object.freeze({__proto__:null,API_URL:Ea,getTermFromElement:La,informativeRefsInNormative:Aa,name:Sa,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:Ea,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in Ra?Object.assign(n,{specs:Ra[e.toLowerCase()]}):r(e);break;case"array":Object.assign(n,{specs:e});break;case"object":if(Object.assign(n,e),e.profile){const t=e.profile.toLowerCase();if(t in Ra){const r=(e.specs??[]).concat(Ra[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:Sn(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Sa)}return n;function r(e){Sn(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${en(Object.keys(Ra),(e=>`"${e}"`))}.`,Sa)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=fa.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])"),t=document.querySelectorAll("dfn.externalDFN");return[...e].filter((e=>{if(""===e.textContent.trim())return!1;const t=e.closest("[data-cite]");return!t||""!==t.dataset.cite})).concat(...t)}());if(!n.length)return;const r=[];for(const e of n){const t=Ta(e);t.id=await Ia(t),r.push(t)}const i=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await Ca(r),i=r.filter((e=>!s.get(e.id))),o=await async function(e,t){if(!e.length)return new Map;const n={keys:e},r={method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}},s=await fetch(t,r),i=await s.json();return new Map(i.result)}(i,t);o.size&&await async function(e,t){try{const n=(await _a()).transaction(ka,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(ka).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...s,...o])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let i=0,o=e.length;i<o;i++){if(e[i].closest("[data-no-xref]"))continue;const o=e[i],a=t[i],{id:c}=a,l=n.get(c);if(1===l.length)Pa(o,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(o)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(Ea);return r.searchParams.set("term",e),t.for&&r.searchParams.set("for",t.for),r.searchParams.set("types",t.types.join(",")),n.length&&r.searchParams.set("specs",n.join(",")),r.href},r=(e,t)=>Pn`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:s}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],i=La(s[0]),o=n(i,e),a=Qt(t,(e=>`**[${e}]**`)),c=r(o,i);Sn(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,Sa,{title:"No matching definition found.",elements:s,hint:c})}for(const{query:t,elems:s,results:i}of e.values()){const e=[...new Set(i.map((e=>e.shortname)))].sort(),o=Qt(e,(e=>`**[${e}]**`)),a=La(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=Pn`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification. ${r(c,a)}.`;Sn(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,Sa,{title:"Definition is ambiguous.",elements:s,hint:u})}}(s)}(n,r,i,e),s("beforesave",Na)}});var ja=String.raw`ul.index{columns:30ch;column-gap:1.5em} + >`;e.prepend(t),Fo(t)}var ra=Object.freeze({__proto__:null,addIDLHeader:na,name:Go,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=Ho,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(ta),r=qt.validate(n);for(const t of r){let r=`<pre>${nn(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${nn(qt.write(n[t.sourceName]))}</pre>`}Rn(`WebIDL validation error: ${t.bareMessage}`,Vo,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const sa="core/data-cite",ia="__SPEC__";async function oa(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===ia)i=document.location.href;else{const e=await vi(t);if(!e)return null;i=e.href,o=e.title}if(s)i=s;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:o}}function aa(e,t,n){const{href:r,title:s}=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=s),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?bn(e,t):(t.textContent=s,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Rn("Exporting an linked external definition is not allowed.",sa,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function ca(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const la=ca("#"),ua=ca("/");function da(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:i}=r?da(r):{key:ia,isNormative:!1};return t.cite=i?s:`?${s}`,t.citeFrag=n.replace("#",""),da(e)}const o=r?`#${r}`:la(n),a=s||ua(n).split("#")[0],{type:c}=gn(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:o,path:a,href:i}}function pa(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 fa=Object.freeze({__proto__:null,THIS_SPEC:ia,name:sa,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(da).map((async e=>({entry:e,result:await vi(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await wi(n);r&&Object.assign(hi,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=da(t),r=await oa(n);if(r)aa(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),En(n,sa,{elements:[t]})}}s("beforesave",pa)},toCiteDetails:da});const ha="core/link-to-dfn",ma=[],ga={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:"在文档中有重复的定义。"}},ba=sn(ga);function ya(e){const t=new Map,n=[];for(const r of oo.get(e)){const{dfnType:s="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const o of i){if(t.has(o)&&t.get(o).has(s)){const e=t.get(o).get(s),i="dfn"===e.localName,a="dfn"===r.localName,c=s===(e.dataset.dfnType||"dfn"),l=!o&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(o);if(i&&a&&c&&l){n.push(r);continue}}t.has(o)||t.set(o,new Map),t.get(o).set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(o).set("idl",r),fn(r,"dfn",e)}}return{result:t,duplicates:n}}function wa(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=hn(e).reduce(((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[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 s=t.get(r.title).get(r.for),{linkType:i}=e.dataset;if(i)return s.get(i)||s.get("dfn");{const e=r.for?"idl":"dfn";return s.get(e)||s.get("idl")}}function va(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&i&&!i.split(",").map((e=>e.trim())).includes(s))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"),s=$a(e)&&$a(t,n);r&&!s||bn(e,document.createElement("code"))}(e,t),!r}function $a(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 ka(e){e.forEach((e=>{En(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,ha,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var xa=Object.freeze({__proto__:null,name:ha,possibleExternalLinks:ma,run:async function(e){const t=function(){const e=new Cn;for(const t of oo.keys()){const{result:n,duplicates:r}=ya(t);e.set(t,n),r.length>0&&Rn(ba.duplicateMsg(t),ha,{title:ba.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){ma.push(e);continue}const r=wa(e,t);if(r){va(e,r,t)||ma.push(e)}else""===e.dataset.cite?n.push(e):ma.push(e)}ka(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:s}=da(t);r!==ia&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||ka(ma)}});const _a="xrefs",Ca=3e5;async function Sa(){return await jt.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(_a,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Ra(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<Ca)return!1;const r=new URL("meta/version",Ta).href,s=await fetch(r);if(!s.ok)return!1;const i=await s.text();return localStorage.setItem(e,n.toString()),parseInt(i,10)>t}())return await async function(){try{await Sa().then((e=>e.clear(_a)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await Sa();let r=await e.transaction(_a).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const Ea="core/xref",Aa={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},Ta="https://respec.org/xref/",La=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Kt({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Pa(e){const t="xrefType"in e.dataset;let n=Ia(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter((e=>e));if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map((e=>e.textContent.toLowerCase()));r.length&&t.push(r)}return function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter((t=>!e.includes(t)));t.push(r.sort())}return t}(t)}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return rn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return rn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function Ia(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=rn(n),"the-empty-string"===n?"":n}function Da(e,t,n,r){const{term:s,specs:i=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=i.flat().includes(c)?c:a,f=new URL(o,"https://partial"),{pathname:h}=f,m={cite:p,citePath:h,citeFrag:f.hash.slice(1),type:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){if(!function(e){const t=e.closest(".normative"),n=e.closest(Yt);return!n||e===t||t&&n&&n.contains(t)}(e))return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}La.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Na(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Oa)}function Oa(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function ja(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach((e=>{n.forEach((t=>e.removeAttribute(t)))}))}var Ma=Object.freeze({__proto__:null,API_URL:Ta,getTermFromElement:Ia,informativeRefsInNormative:La,name:Ea,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:Ta,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in Aa?Object.assign(n,{specs:Aa[e.toLowerCase()]}):r(e);break;case"array":Object.assign(n,{specs:e});break;case"object":if(Object.assign(n,e),e.profile){const t=e.profile.toLowerCase();if(t in Aa){const r=(e.specs??[]).concat(Aa[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:Rn(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Ea)}return n;function r(e){Rn(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${tn(Object.keys(Aa),(e=>`"${e}"`))}.`,Ea)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=ma.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])"),t=document.querySelectorAll("dfn.externalDFN");return[...e].filter((e=>{if(""===e.textContent.trim())return!1;const t=e.closest("[data-cite]");return!t||""!==t.dataset.cite})).concat(...t)}());if(!n.length)return;const r=[];for(const e of n){const t=Pa(e);t.id=await Na(t),r.push(t)}const i=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await Ra(r),i=r.filter((e=>!s.get(e.id))),o=await async function(e,t){if(!e.length)return new Map;const n={keys:e},r={method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}},s=await fetch(t,r),i=await s.json();return new Map(i.result)}(i,t);o.size&&await async function(e,t){try{const n=(await Sa()).transaction(_a,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(_a).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...s,...o])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let i=0,o=e.length;i<o;i++){if(e[i].closest("[data-no-xref]"))continue;const o=e[i],a=t[i],{id:c}=a,l=n.get(c);if(1===l.length)Da(o,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(o)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(Ta);return r.searchParams.set("term",e),t.for&&r.searchParams.set("for",t.for),r.searchParams.set("types",t.types.join(",")),n.length&&r.searchParams.set("specs",n.join(",")),r.href},r=(e,t)=>In`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:s}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],i=Ia(s[0]),o=n(i,e),a=en(t,(e=>`**[${e}]**`)),c=r(o,i);Rn(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,Ea,{title:"No matching definition found.",elements:s,hint:c})}for(const{query:t,elems:s,results:i}of e.values()){const e=[...new Set(i.map((e=>e.shortname)))].sort(),o=en(e,(e=>`**[${e}]**`)),a=Ia(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=In`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification. ${r(c,a)}.`;Rn(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,Ea,{title:"Definition is ambiguous.",elements:s,hint:u})}}(s)}(n,r,i,e),s("beforesave",ja)}});var za=String.raw`ul.index{columns:30ch;column-gap:1.5em} ul.index li{list-style:inherit} ul.index li span{color:inherit;cursor:pointer;white-space:normal} #index-defined-here ul.index li{font-size:.9rem} @@ -956,37 +958,37 @@ ul.index code{color:inherit} #index-defined-here .print-only{display:none} @media print{ #index-defined-here .print-only{display:initial} -}`;const Ma=rn({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),za=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Ua(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function qa(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function Wa(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${qa(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${qa(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${qa(e)}</code>`;default:return""}}function Fa(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.append((e=>{const t=`§${document.getElementById(e).closest("section").querySelector(".secno").textContent.trim()}`;return Nt`<span class="print-only">${t}</span>`})(e.dataset.id))))}function Ba(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const n=r.href;if(e.has(n))continue;const{type:s,linkFor:i}=r.dataset,o=La(r);if(!o)continue;const a=la(r).key.toUpperCase();(t.get(a)||t.set(a,[]).get(a)).push({term:o,type:s,linkFor:i,elem:r}),e.add(n)}return t}function Ha(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=t;za.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const i=Va.has(t)?"type":Ga.get(n);i&&(s+=` ${i}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return Nt`<li> +}`;const Ua=sn({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),qa=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Wa(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Fa(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function Ba(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${Fa(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${Fa(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${Fa(e)}</code>`;default:return""}}function Ha(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.append((e=>{const t=`§${document.getElementById(e).closest("section").querySelector(".secno").textContent.trim()}`;return Ot`<span class="print-only">${t}</span>`})(e.dataset.id))))}function Ga(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const n=r.href;if(e.has(n))continue;const{type:s,linkFor:i}=r.dataset,o=Ia(r);if(!o)continue;const a=da(r).key.toUpperCase();(t.get(a)||t.set(a,[]).get(a)).push({term:o,type:s,linkFor:i,elem:r}),e.add(n)}return t}function Va(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=t;qa.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const i=Ka.has(t)?"type":Ya.get(n);i&&(s+=` ${i}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return Ot`<li> <span class="index-term" data-href="${t.href}">${{html:n}}</span> - </li>`}const Ga=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Va=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function Ya(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var Ka=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void s("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=ja,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(Nt`<h1>${Ma.heading}</h1>`);const n=Nt`<section id="index-defined-here"> - <h3>${Ma.headlingLocal}</h3> - ${function(){const e=function(){const e=new Map,t=document.querySelectorAll("dfn:not([data-cite])");for(const n of t){if(!n.id)continue;const t=nn(n.textContent);(e.get(t)||e.set(t,[]).get(t)).push(n)}return[...e].sort((([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/)))))}();return Nt`<ul class="index"> - ${e.map((([e,t])=>function(e,t){const n=(e,t,n)=>{const r=`#${e.id}`;return Nt`<li data-id=${e.id}> + </li>`}const Ya=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Ka=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function Za(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var Ja=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void s("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=za,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(Ot`<h1>${Ua.heading}</h1>`);const n=Ot`<section id="index-defined-here"> + <h3>${Ua.headlingLocal}</h3> + ${function(){const e=function(){const e=new Map,t=document.querySelectorAll("dfn:not([data-cite])");for(const n of t){if(!n.id)continue;const t=rn(n.textContent);(e.get(t)||e.set(t,[]).get(t)).push(n)}return[...e].sort((([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/)))))}();return Ot`<ul class="index"> + ${e.map((([e,t])=>function(e,t){const n=(e,t,n)=>{const r=`#${e.id}`;return Ot`<li data-id=${e.id}> <a class="index-term" href="${r}">${{html:t}}</a> ${n?{html:n}:""} - </li>`};if(1===t.length){const r=t[0],s=Ua(r),i=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(za.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),o=Wa(r,s,e);return n(r,i,o)}return Nt`<li> + </li>`};if(1===t.length){const r=t[0],s=Wa(r),i=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(qa.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),o=Ba(r,s,e);return n(r,i,o)}return Ot`<li> ${e} <ul> - ${t.map((t=>{const r=Wa(t,Ua(t),e)||Ma.dfnOf;return n(t,r)}))} + ${t.map((t=>{const r=Ba(t,Wa(t),e)||Ua.dfnOf;return n(t,r)}))} </ul> </li>`}(e,t)))} </ul>`}()} - </section>`;e.append(n);const r=Nt`<section id="index-defined-elsewhere"> - <h3>${Ma.headingExternal}</h3> - ${function(){const e=[...Ba().entries()].sort((([e],[t])=>e.localeCompare(t)));return Nt`<ul class="index"> - ${e.map((([e,t])=>Nt`<li data-spec="${e}"> - ${Ri(e)} defines the following: + </section>`;e.append(n);const r=Ot`<section id="index-defined-elsewhere"> + <h3>${Ua.headingExternal}</h3> + ${function(){const e=[...Ga().entries()].sort((([e],[t])=>e.localeCompare(t)));return Ot`<ul class="index"> + ${e.map((([e,t])=>Ot`<li data-spec="${e}"> + ${Ai(e)} defines the following: <ul> - ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(Ha)} + ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(Va)} </ul> </li>`))} </ul>`}()} - </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))pn(e,"index-term");s("toc",Fa,{once:!0}),s("beforesave",Ya)}});const Za="core/contrib";var Ja=Object.freeze({__proto__:null,name:Za,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Sn(Pn`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Za)}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 s();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 Nt(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=Qt(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await cn(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 Sn("Error loading contributors from GitHub.",Za),console.error(e),null}}}(t,n)}});var Xa=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);hn(e,`h${t}`)}))}});var Qa=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map((e=>`h${e}:first-child`)).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter((e=>!e.closest(Vt)));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map((e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),e.appendChild(r),gn(r,document.createElement("code")),ea(r)}});const ec=["h2","h3","h4","h5","h6"],tc="core/structure",nc=rn({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function rc(e,t,{prefix:n=""}={}){let r=!1,s=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=Nt`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=i,r=!0);let e=a.isIntro?"":r?sc(i-s+1):n+i;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(Nt`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=oc(a.header,n),s=rc(a.subsections,t,{prefix:e});s&&r.append(s),o.append(r)}}return o}function sc(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function ic(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(!ec.includes(r.localName))continue;const s=r.textContent;pn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:ic(e)})}return n}function oc(e,t){const n=Nt`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=hn(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{hn(e,"span").removeAttribute("id")})),Nt`<li class="tocline">${n}</li>`}var ac=Object.freeze({__proto__:null,name:tc,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(yn(e,"section").length+1,6)}`;e.localName!==t&&hn(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)){Sn("`data-max-toc` must have a value between 0-6 (inclusive).",tc,{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=rc(ic(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Nt`<nav id="toc"></nav>`,n=Nt`<h2 class="introductory">${nc.toc}</h2>`;pn(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 s=Nt`<p role="navigation" id="back-to-top"> + </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))fn(e,"index-term");s("toc",Ha,{once:!0}),s("beforesave",Za)}});const Xa="core/contrib";var Qa=Object.freeze({__proto__:null,name:Xa,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Rn(In`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Xa)}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 s();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 Ot(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=en(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await ln(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 Rn("Error loading contributors from GitHub.",Xa),console.error(e),null}}}(t,n)}});var ec=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);mn(e,`h${t}`)}))}});var tc=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map((e=>`h${e}:first-child`)).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter((e=>!e.closest(Yt)));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map((e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),e.appendChild(r),bn(r,document.createElement("code")),na(r)}});const nc=["h2","h3","h4","h5","h6"],rc="core/structure",sc=sn({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function ic(e,t,{prefix:n=""}={}){let r=!1,s=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=Ot`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=i,r=!0);let e=a.isIntro?"":r?oc(i-s+1):n+i;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(Ot`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=cc(a.header,n),s=ic(a.subsections,t,{prefix:e});s&&r.append(s),o.append(r)}}return o}function oc(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function ac(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(!nc.includes(r.localName))continue;const s=r.textContent;fn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:ac(e)})}return n}function cc(e,t){const n=Ot`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=mn(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{mn(e,"span").removeAttribute("id")})),Ot`<li class="tocline">${n}</li>`}var lc=Object.freeze({__proto__:null,name:rc,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(wn(e,"section").length+1,6)}`;e.localName!==t&&mn(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)){Rn("`data-max-toc` must have a value between 0-6 (inclusive).",rc,{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=ic(ac(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Ot`<nav id="toc"></nav>`,n=Ot`<h2 class="introductory">${sc.toc}</h2>`;fn(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 s=Ot`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> - </p>`;document.body.append(s)}(t)}r("toc")}});const cc=rn({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 lc=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(Nt`<p><em>${cc.informative}</em></p>`)}))}});const uc=rn({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${nn(t.textContent)}`),n}}});var dc=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||(pn(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=uc.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=Nt`<div class="header-wrapper"></div>`;n.replaceWith(s);const i=Nt`<a + </p>`;document.body.append(s)}(t)}r("toc")}});const uc=sn({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 dc=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(Ot`<p><em>${uc.informative}</em></p>`)}))}});const pc=sn({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${rn(t.textContent)}`),n}}});var fc=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||(fn(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=pc.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=Ot`<div class="header-wrapper"></div>`;n.replaceWith(s);const i=Ot`<a href="#${t}" class="self-link" aria-label="${r}" - ></a>`;s.append(n,i)}}});var pc=String.raw`.caniuse-stats{display:flex;column-gap:2em} + ></a>`;s.append(n,i)}}});var hc=String.raw`.caniuse-stats{display:flex;column-gap:2em} .caniuse-group{display:flex;flex:1;flex-direction:column;justify-content:flex-end;flex-basis:auto} .caniuse-browsers{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;margin-top:.2em;column-gap:.4em;border-bottom:1px solid #ccc;row-gap:.4em;padding-bottom:.4cm} .caniuse-type{align-self:center;border-top:none;text-transform:capitalize;font-size:.8em;margin-top:-.8em;font-weight:700} @@ -1004,12 +1006,12 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666)} .caniuse-cell.y::before{content:"✔️";padding:.5em} .caniuse-cell.n::before{content:"❌";padding:.5em} .caniuse-cell:is(.a,.d,.p,.x,.u)::before{content:"⚠️";padding:.5em} -}`;const fc="core/caniuse",hc="https://respec.org/caniuse/",mc=new Map([["and_chr",{name:"Android Chrome",path:"chrome",type:"mobile"}],["and_ff",{name:"Android Firefox",path:"firefox",type:"mobile"}],["and_uc",{name:"Android UC",path:"uc",type:"mobile"}],["chrome",{name:"Chrome",type:"desktop"}],["edge",{name:"Edge",type:"desktop"}],["firefox",{name:"Firefox",type:"desktop"}],["ios_saf",{name:"iOS Safari",path:"safari-ios",type:"mobile"}],["op_mob",{name:"Opera Mobile",path:"opera",type:"mobile"}],["opera",{name:"Opera",type:"desktop"}],["safari",{name:"Safari",type:"desktop"}],["samsung",{name:"Samsung Internet",path:"samsung-internet",type:"mobile"}]]),gc=new Map([["a","almost supported (aka Partial support)"],["d","disabled by default"],["n","no support, or disabled by default"],["p","no support, but has Polyfill"],["u","unknown support"],["x","requires prefix to work"],["y","supported by default"]]);var bc=Object.freeze({__proto__:null,BROWSERS:mc,name:fc,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(mc.keys());t.delete("op_mob"),t.delete("opera");const n={removeOnSave:!0,browsers:[...t]};if("string"==typeof e.caniuse)return void(e.caniuse={feature:e.caniuse,...n});e.caniuse={...n,...e.caniuse}}(e),function({caniuse:e}){const{browsers:t}=e,n=t.filter((e=>!mc.has(e)));if(n.length){Rn(Pn`Invalid browser(s): (${Tn(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,fc)}}(e);const t=e.caniuse;t.feature&&document.head.appendChild(Nt`<style +}`;const mc="core/caniuse",gc="https://respec.org/caniuse/",bc=new Map([["and_chr",{name:"Android Chrome",path:"chrome",type:"mobile"}],["and_ff",{name:"Android Firefox",path:"firefox",type:"mobile"}],["and_uc",{name:"Android UC",path:"uc",type:"mobile"}],["chrome",{name:"Chrome",type:"desktop"}],["edge",{name:"Edge",type:"desktop"}],["firefox",{name:"Firefox",type:"desktop"}],["ios_saf",{name:"iOS Safari",path:"safari-ios",type:"mobile"}],["op_mob",{name:"Opera Mobile",path:"opera",type:"mobile"}],["opera",{name:"Opera",type:"desktop"}],["safari",{name:"Safari",type:"desktop"}],["samsung",{name:"Samsung Internet",path:"samsung-internet",type:"mobile"}]]),yc=new Map([["a","almost supported (aka Partial support)"],["d","disabled by default"],["n","no support, or disabled by default"],["p","no support, but has Polyfill"],["u","unknown support"],["x","requires prefix to work"],["y","supported by default"]]);var wc=Object.freeze({__proto__:null,BROWSERS:bc,name:mc,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(bc.keys());t.delete("op_mob"),t.delete("opera");const n={removeOnSave:!0,browsers:[...t]};if("string"==typeof e.caniuse)return void(e.caniuse={feature:e.caniuse,...n});e.caniuse={...n,...e.caniuse}}(e),function({caniuse:e}){const{browsers:t}=e,n=t.filter((e=>!bc.has(e)));if(n.length){En(In`Invalid browser(s): (${Ln(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,mc)}}(e);const t=e.caniuse;t.feature&&document.head.appendChild(Ot`<style id="caniuse-stylesheet" class="${t.removeOnSave?"removeOnSave":""}" > - ${pc} - </style>`)},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,i=document.querySelector(".head dl"),o=async function(e){const{feature:t,browsers:n,apiURL:r}=e,s=new URL(r||`./${t}`,hc);n.forEach((e=>s.searchParams.append("browsers",e)));const i=await fetch(s);if(!i.ok){const{status:e,statusText:t}=i;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return i.json()}(e.caniuse).then((e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),s=function(e){return(t,{browser:n,version:r,caniuse:s})=>{const{name:i,type:o}=mc.get(n),a=`${i}${r?` version ${r}`:""}`,c=gc.get(s),l=`${e} is ${c} since ${a} on ${o}.`,u=`caniuse-cell ${s}`,d=(p=`${c} since ${a}.`).charAt(0).toUpperCase()+p.slice(1);var p;const f=r||"—",h=function(e){const t=mc.get(e).path??e;return`https://cdn.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),m=Nt` + ${hc} + </style>`)},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,i=document.querySelector(".head dl"),o=async function(e){const{feature:t,browsers:n,apiURL:r}=e,s=new URL(r||`./${t}`,gc);n.forEach((e=>s.searchParams.append("browsers",e)));const i=await fetch(s);if(!i.ok){const{status:e,statusText:t}=i;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return i.json()}(e.caniuse).then((e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),s=function(e){return(t,{browser:n,version:r,caniuse:s})=>{const{name:i,type:o}=bc.get(n),a=`${i}${r?` version ${r}`:""}`,c=yc.get(s),l=`${e} is ${c} since ${a} on ${o}.`,u=`caniuse-cell ${s}`,d=(p=`${c} since ${a}.`).charAt(0).toUpperCase()+p.slice(1);var p;const f=r||"—",h=function(e){const t=bc.get(e).path??e;return`https://cdn.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),m=Ot` <div class="${u}" title="${d}" aria-label="${l}"> <img class="caniuse-browser" @@ -1019,16 +1021,16 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666)} alt="${i} logo" /><span class="browser-version">${f}</span> </div> - `;return t.get(o).push(m),t}}(t);n.reduce(s,r);const i=[...r].filter((([,e])=>e.length)).map((([e,t])=>Nt`<div class="caniuse-group"> + `;return t.get(o).push(m),t}}(t);n.reduce(s,r);const i=[...r].filter((([,e])=>e.length)).map((([e,t])=>Ot`<div class="caniuse-group"> <div class="caniuse-browsers">${t}</div> <div class="caniuse-type"><span>${e}</div> - </div>`));return i.push(Nt`<a class="caniuse-cell" href="https://caniuse.com/${t}" + </div>`));return i.push(Ot`<a class="caniuse-cell" href="https://caniuse.com/${t}" >More info</a - >`),i}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=Pn`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return Sn(r,fc,{hint:s}),console.error(e),Nt`<a href="${n}">caniuse.com</a>`}(e,t,n))),a=Nt`<dt class="caniuse-title">Browser support:</dt> + >`),i}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=In`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return Rn(r,mc,{hint:s}),console.error(e),Ot`<a href="${n}">caniuse.com</a>`}(e,t,n))),a=Ot`<dt class="caniuse-title">Browser support:</dt> <dd class="caniuse-stats"> ${{any:o,placeholder:"Fetching data from caniuse.com..."}} - </dd>`;i.append(...a.childNodes),await o,r("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(i.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),s("beforesave",(e=>{Nt.bind(e.querySelector(".caniuse-stats"))` - <a href="${n}">caniuse.com</a>`})))}});var yc=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem} + </dd>`;i.append(...a.childNodes),await o,r("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(i.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),s("beforesave",(e=>{Ot.bind(e.querySelector(".caniuse-stats"))` + <a href="${n}">caniuse.com</a>`})))}});var vc=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem} .mdn details{width:100%;margin:1px 0;position:relative;z-index:10;box-sizing:border-box;padding:.4em;padding-top:0} .mdn details[open]{min-width:25ch;max-width:32ch;background:#fff;box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);border-radius:2px;z-index:11;margin-bottom:.4em} .mdn summary{text-align:right;cursor:default;margin-right:-.4em} @@ -1051,33 +1053,33 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666)} .mdn .safari::before{background-image:url(https://cdn.w3.org/assets/logos/browser-logos/safari/safari.svg)} .mdn .safari_ios::before{background-image:url(https://cdn.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg)} .mdn .samsunginternet_android::before{background-image:url(https://cdn.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg)} -.mdn .webview_android::before{background-image:url(https://cdn.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)}`;const wc="core/mdn-annotation",vc="https://w3c.github.io/mdn-spec-links/",$c={chrome:"Chrome",chrome_android:"Chrome Android",edge:"Edge",edge_mobile:"Edge Mobile",firefox:"Firefox",firefox_android:"Firefox Android",opera:"Opera",opera_android:"Opera Android",safari:"Safari",safari_ios:"Safari iOS",samsunginternet_android:"Samsung Internet",webview_android:"WebView Android"},kc=rn({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"}});function xc(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=Nt`<aside class="mdn"></aside>`;return t.before(r),r}function _c(e){const{name:t,slug:n,summary:r,support:s,engines:i}=e,o=n.slice(n.indexOf("/")+1),a=`https://developer.mozilla.org/en-US/docs/Web/${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return Nt`<span title="${kc.inAllEngines}">✅</span>`;if(e.length<2)return Nt`<span title="${kc.inSomeEngines}">🚫</span>`;return Nt`<span> </span>`}(i);return Nt`<details> +.mdn .webview_android::before{background-image:url(https://cdn.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)}`;const $c="core/mdn-annotation",kc="https://w3c.github.io/mdn-spec-links/",xc={chrome:"Chrome",chrome_android:"Chrome Android",edge:"Edge",edge_mobile:"Edge Mobile",firefox:"Firefox",firefox_android:"Firefox Android",opera:"Opera",opera_android:"Opera Android",safari:"Safari",safari_ios:"Safari iOS",samsunginternet_android:"Samsung Internet",webview_android:"WebView Android"},_c=sn({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"}});function Cc(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=Ot`<aside class="mdn"></aside>`;return t.before(r),r}function Sc(e){const{name:t,slug:n,summary:r,support:s,engines:i}=e,o=n.slice(n.indexOf("/")+1),a=`https://developer.mozilla.org/en-US/docs/Web/${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return Ot`<span title="${_c.inAllEngines}">✅</span>`;if(e.length<2)return Ot`<span title="${_c.inSomeEngines}">🚫</span>`;return Ot`<span> </span>`}(i);return Ot`<details> <summary aria-label="${c}"><span>MDN</span>${l}</summary> <a title="${r}" href="${a}">${o}</a> - ${function(e){if(3===e.length)return Nt`<p class="engines-all">${kc.inAllEngines}</p>`;if(e.length<2)return Nt`<p class="engines-some">${kc.inSomeEngines}</p>`}(i)} - ${s?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,s=`${e} ${t.toLowerCase()}`;return Nt`<tr class="${s}"> - <td>${$c[e]}</td> + ${function(e){if(3===e.length)return Ot`<p class="engines-all">${_c.inAllEngines}</p>`;if(e.length<2)return Ot`<p class="engines-some">${_c.inSomeEngines}</p>`}(i)} + ${s?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,s=`${e} ${t.toLowerCase()}`;return Ot`<tr class="${s}"> + <td>${xc[e]}</td> <td>${n||r}</td> - </tr>`}function n(e,n){if(n.version_removed)return t(e,"No","");const r=n.version_added;return"boolean"==typeof r?t(e,r?"Yes":"No",""):r?t(e,"Yes",`${r}+`):t(e,"Unknown","")}return Nt`<table> - ${Object.keys($c).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))} - </table>`}(s):Nt`<p class="nosupportdata">No support data.</p>`} - </details>`}var Cc=Object.freeze({__proto__:null,name:wc,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return"string"==typeof n?n:n.key||t}(e);if(!t)return;const n=await async function(e,t){const{baseJsonPath:n=vc,maxAge:r=864e5}=t,s=new URL(`${e}.json`,n).href,i=await cn(s,r);if(404===i.status){return void Sn(`Could not find MDN data associated with key "${e}".`,wc,{hint:"Please add a valid key to `respecConfig.mdn`"})}return await i.json()}(t,e.mdn);if(!n)return;const r=document.createElement("style");r.textContent=yc,document.head.append(r);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter((({id:t})=>Array.isArray(e[t])))}(n)){const t=n[e.id],r=xc(e);if(r)for(const e of t)r.append(_c(e))}}});const Sc="ui/save-html",Rc=rn({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Ec=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Dn(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Dn(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}}];var Ac=Object.freeze({__proto__:null,exportDocument:function(e,t){return Rn("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Sc,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Dn(t)},name:Sc,run:function(e){const t={async show(t){await document.respec.ready;const n=Nt`<div class="respec-save-buttons"> - ${Ec.map((t=>function(e,t){const{id:n,href:r,ext:s,title:i,type:o}=e,a=on(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Nt`<a + </tr>`}function n(e,n){if(n.version_removed)return t(e,"No","");const r=n.version_added;return"boolean"==typeof r?t(e,r?"Yes":"No",""):r?t(e,"Yes",`${r}+`):t(e,"Unknown","")}return Ot`<table> + ${Object.keys(xc).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))} + </table>`}(s):Ot`<p class="nosupportdata">No support data.</p>`} + </details>`}var Rc=Object.freeze({__proto__:null,name:$c,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return"string"==typeof n?n:n.key||t}(e);if(!t)return;const n=await async function(e,t){const{baseJsonPath:n=kc,maxAge:r=864e5}=t,s=new URL(`${e}.json`,n).href,i=await ln(s,r);if(404===i.status){return void Rn(`Could not find MDN data associated with key "${e}".`,$c,{hint:"Please add a valid key to `respecConfig.mdn`"})}return await i.json()}(t,e.mdn);if(!n)return;const r=document.createElement("style");r.textContent=vc,document.head.append(r);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter((({id:t})=>Array.isArray(e[t])))}(n)){const t=n[e.id],r=Cc(e);if(r)for(const e of t)r.append(Sc(e))}}});const Ec="ui/save-html",Ac=sn({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Tc=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Nn(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Nn(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}}];var Lc=Object.freeze({__proto__:null,exportDocument:function(e,t){return En("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Ec,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Nn(t)},name:Ec,run:function(e){const t={async show(t){await document.respec.ready;const n=Ot`<div class="respec-save-buttons"> + ${Tc.map((t=>function(e,t){const{id:n,href:r,ext:s,title:i,type:o}=e,a=an(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Ot`<a href="${r}" id="${n}" download="${c}.${s}" type="${o}" class="respec-save-button" - onclick=${()=>dr.closeModal()} + onclick=${()=>pr.closeModal()} >${i}</a >`}(t,e)))} - </div>`;dr.freshModal(Rc.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=dr.addCommand(Rc.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Tc="https://respec.org/specref/",Lc=rn({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),Pc=dr.addCommand(Lc.search_specref,(function(){const e=Nt` - <iframe class="respec-iframe" src="${Tc}" onload=${e=>e.target.classList.add("ready")}></iframe> - <a href="${Tc}" target="_blank">Open Search UI in a new tab</a> - `;dr.freshModal(Lc.search_specref,e,Pc)}),"Ctrl+Shift+Alt+space","🔎");var Ic=Object.freeze({__proto__:null});const Dc="https://respec.org/xref/",Nc=rn({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"}}),Oc=dr.addCommand(Nc.title,(function(){const e=Nt` - <iframe class="respec-iframe" src="${Dc}" onload="${e=>e.target.classList.add("ready")}"></iframe> - <a href="${Dc}" target="_blank">Open Search UI in a new tab</a> - `;dr.freshModal(Nc.title,e,Oc)}),"Ctrl+Shift+Alt+x","📚");var jc=Object.freeze({__proto__:null});const Mc=rn({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 zc=document.createElement("div"),Uc=Nt.bind(zc),qc=dr.addCommand(`${Mc.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(Wc).forEach((t=>{e.push(t)}));Uc` + </div>`;pr.freshModal(Ac.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=pr.addCommand(Ac.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Pc="https://respec.org/specref/",Ic=sn({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),Dc=pr.addCommand(Ic.search_specref,(function(){const e=Ot` + <iframe class="respec-iframe" src="${Pc}" onload=${e=>e.target.classList.add("ready")}></iframe> + <a href="${Pc}" target="_blank">Open Search UI in a new tab</a> + `;pr.freshModal(Ic.search_specref,e,Dc)}),"Ctrl+Shift+Alt+space","🔎");var Nc=Object.freeze({__proto__:null});const Oc="https://respec.org/xref/",jc=sn({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"}}),Mc=pr.addCommand(jc.title,(function(){const e=Ot` + <iframe class="respec-iframe" src="${Oc}" onload="${e=>e.target.classList.add("ready")}"></iframe> + <a href="${Oc}" target="_blank">Open Search UI in a new tab</a> + `;pr.freshModal(jc.title,e,Mc)}),"Ctrl+Shift+Alt+x","📚");var zc=Object.freeze({__proto__:null});const Uc=sn({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 qc=document.createElement("div"),Wc=Ot.bind(qc),Fc=pr.addCommand(`${Uc.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(Bc).forEach((t=>{e.push(t)}));Wc` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -1101,12 +1103,12 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666)} </thead> <tbody>${e}</tbody> </table> -`,dr.freshModal(`${Mc.about_respec} - ${window.respecVersion}`,zc,qc)}),"Ctrl+Shift+Alt+A","ℹ️");function Wc({name:e,duration:t}){return Nt` +`,pr.freshModal(`${Uc.about_respec} - ${window.respecVersion}`,qc,Fc)}),"Ctrl+Shift+Alt+A","ℹ️");function Bc({name:e,duration:t}){return Ot` <tr> <td><a href="${`https://github.com/w3c/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}var Fc=Object.freeze({__proto__:null});var Bc=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)}});const Hc="w3c/seo",Gc={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",PER:"w3p:PER",RSCND:"w3p:RSCND"},Vc=new Set([...Hr,...Gr,...Vr,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Yc({name:e,url:t,mailto:n,company:r,companyURL:s}){const i={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||s)&&(i.worksFor={name:r,url:s}),i}function Kc(e){const{href:t,title:n,href:r}=e,s={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(s.creator=e.authors.map((e=>({name:e})))),e.rawDate&&(s.publishedDate=e.rawDate),e.isbn&&(s.identifier=e.isbn),e.publisher&&(s.publisher={name:e.publisher}),s}var Zc=Object.freeze({__proto__:null,name:Hc,requiresCanonicalLink:Vc,run:async function(e){if((e.canonicalURI||Vc.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{Rn("Canonical URI set to edDraft, but no edDraftURI is set in configuration",Hc),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{Rn("Canonical URI set to TR, but no shortName is set in configuration",Hc),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=Nt`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Gc[e.specStatus],r=["TechArticle"];n&&r.push(n);const s={"@context":["http://schema.org",{"@vocab":"http://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];s.copyrightHolder=[s.copyrightHolder,...t.map((e=>({name:e})))]}const i=t.head.querySelector("meta[name=description]");i&&(s.description=i.content);e.editors&&(s.editor=e.editors.map(Yc));e.authors&&(s.contributor=e.authors.map(Yc));const o=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(o.map((e=>yi(e))));s.citation=a.filter((e=>"object"==typeof e)).map(Kc);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var Jc=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa} + `}var Hc=Object.freeze({__proto__:null});var Gc=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)}});const Vc="w3c/seo",Yc={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",PER:"w3p:PER",RSCND:"w3p:RSCND"},Kc=new Set([...Vr,...Yr,...Kr,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Zc({name:e,url:t,mailto:n,company:r,companyURL:s}){const i={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||s)&&(i.worksFor={name:r,url:s}),i}function Jc(e){const{href:t,title:n,href:r}=e,s={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(s.creator=e.authors.map((e=>({name:e})))),e.rawDate&&(s.publishedDate=e.rawDate),e.isbn&&(s.identifier=e.isbn),e.publisher&&(s.publisher={name:e.publisher}),s}var Xc=Object.freeze({__proto__:null,name:Vc,requiresCanonicalLink:Kc,run:async function(e){if((e.canonicalURI||Kc.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{En("Canonical URI set to edDraft, but no edDraftURI is set in configuration",Vc),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{En("Canonical URI set to TR, but no shortName is set in configuration",Vc),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=Ot`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Yc[e.specStatus],r=["TechArticle"];n&&r.push(n);const s={"@context":["http://schema.org",{"@vocab":"http://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];s.copyrightHolder=[s.copyrightHolder,...t.map((e=>({name:e})))]}const i=t.head.querySelector("meta[name=description]");i&&(s.description=i.content);e.editors&&(s.editor=e.editors.map(Zc));e.authors&&(s.contributor=e.authors.map(Zc));const o=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(o.map((e=>vi(e))));s.citation=a.filter((e=>"object"==typeof e)).map(Jc);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var Qc=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} @@ -1117,21 +1119,21 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666)} .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 Xc(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-w3c.js",document.baseURI).href));return await t.text()}const Qc=Yt({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Qc);const el=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return zu}))).default}catch{return Xc("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",el.then((e=>({worker:e}))));const tl=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function nl(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:tl(),languages:t},r=await el;return r.postMessage(n),new Promise(((e,t)=>{const s=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(i){const{data:{id:o,language:a,value:c}}=i;o===n.id&&(r.removeEventListener("message",t),clearTimeout(s),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:s,value:i}=r;switch(e.localName){case"pre":e.classList.remove(s),e.innerHTML=`<code class="hljs${s?` ${s}`:""}">${i}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=i,e.classList.add("hljs"),s&&e.classList.add(s)}e.setAttribute("aria-busy","false")}var rl=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(nl);document.head.appendChild(Nt`<style> - ${Jc} - </style>`),await Promise.all(n)}});const sl=rn({en:{missing_test_suite_uri:Pn`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:Pn`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:Pn`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:Pn`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),il="core/data-tests";function ol(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[s]=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"),s=s.replace(".https",""),t.push(e)}if(s.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"),s=s.replace("-manual",""),t.push(e)}return Nt` +.hljs-link{text-decoration:underline}`;async function el(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-w3c.js",document.baseURI).href));return await t.text()}const tl=Kt({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(tl);const nl=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return qu}))).default}catch{return el("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",nl.then((e=>({worker:e}))));const rl=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function sl(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:rl(),languages:t},r=await nl;return r.postMessage(n),new Promise(((e,t)=>{const s=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(i){const{data:{id:o,language:a,value:c}}=i;o===n.id&&(r.removeEventListener("message",t),clearTimeout(s),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:s,value:i}=r;switch(e.localName){case"pre":e.classList.remove(s),e.innerHTML=`<code class="hljs${s?` ${s}`:""}">${i}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=i,e.classList.add("hljs"),s&&e.classList.add(s)}e.setAttribute("aria-busy","false")}var il=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(sl);document.head.appendChild(Ot`<style> + ${Qc} + </style>`),await Promise.all(n)}});const ol=sn({en:{missing_test_suite_uri:In`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:In`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:In`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:In`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),al="core/data-tests";function cl(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[s]=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"),s=s.replace(".https",""),t.push(e)}if(s.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"),s=s.replace("-manual",""),t.push(e)}return Ot` <li> <a href="${e}">${s}</a> ${t} </li> - `}function al(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{Rn(Pn`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,il,{elements:[n]})}})).filter((e=>e))}function cl(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=Pn`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=Pn`To fix, remove duplicates from ${"[data-tests]"}: ${Tn(n,{quotes:!0})}.`;Rn(e,il,{hint:r,elements:[t]})}}function ll(e){const t=[...new Set(e)];return Nt` + `}function ll(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{En(In`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,al,{elements:[n]})}})).filter((e=>e))}function ul(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=In`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=In`To fix, remove duplicates from ${"[data-tests]"}: ${Ln(n,{quotes:!0})}.`;En(e,al,{hint:r,elements:[t]})}}function dl(e){const t=[...new Set(e)];return Ot` <details class="respec-tests-details removeOnSave"> <summary>tests: ${t.length}</summary> <ul> - ${t.map(ol)} + ${t.map(cl)} </ul> </details> - `}var ul=Object.freeze({__proto__:null,name:il,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=al(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);cl(t,n);const r=ll(t);n.append(r)}else Sn(sl.missing_test_suite_uri,il)}});const dl="core/list-sorter";function pl(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function fl(e,t){return[...e.querySelectorAll(":scope > li")].sort(pl(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function hl(e,t){return[...e.querySelectorAll(":scope > dt")].sort(pl(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,s=document.createDocumentFragment();let{nextSibling:i}=t;for(;i&&i.nextSibling;){s.appendChild(i.cloneNode(!0));const{nodeType:e,nodeName:t}=i.nextSibling;if(e===n&&t===r)break;i=i.nextSibling}return s.prepend(t.cloneNode(!0)),e.appendChild(s),e}),document.createDocumentFragment())}var ml=Object.freeze({__proto__:null,name:dl,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=hl(t,n);break;case"ol":case"ul":e=fl(t,n);break;default:Rn(`ReSpec can't sort ${t.localName} elements.`,dl,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:hl,sortListItems:fl});var gl=String.raw`var:hover{text-decoration:underline;cursor:pointer} + `}var pl=Object.freeze({__proto__:null,name:al,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=ll(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);ul(t,n);const r=dl(t);n.append(r)}else Rn(ol.missing_test_suite_uri,al)}});const fl="core/list-sorter";function hl(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function ml(e,t){return[...e.querySelectorAll(":scope > li")].sort(hl(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function gl(e,t){return[...e.querySelectorAll(":scope > dt")].sort(hl(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,s=document.createDocumentFragment();let{nextSibling:i}=t;for(;i&&i.nextSibling;){s.appendChild(i.cloneNode(!0));const{nodeType:e,nodeName:t}=i.nextSibling;if(e===n&&t===r)break;i=i.nextSibling}return s.prepend(t.cloneNode(!0)),e.appendChild(s),e}),document.createDocumentFragment())}var bl=Object.freeze({__proto__:null,name:fl,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=gl(t,n);break;case"ol":case"ul":e=ml(t,n);break;default:En(`ReSpec can't sort ${t.localName} elements.`,fl,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:gl,sortListItems:ml});var yl=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} @@ -1142,11 +1144,11 @@ 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 bl(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=nn(e.textContent),n=e.closest("section"),r=wl(e),s=[...n.querySelectorAll("var")].filter((e=>nn(e.textContent)===t&&e.closest("section")===n)),i=s[0].classList.contains("respec-hl");if(yl.set(r,i),i)return s.forEach((e=>vl(e,r))),[];s.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return s}(t),r=()=>{const e=wl(t);n.forEach((t=>vl(t,e))),[...yl.keys()].forEach((e=>yl.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const yl=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 wl(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===yl.get("respec-hl-c1")?"respec-hl-c1":[...yl.keys()].find((e=>yl.get(e)))||"respec-hl-c1"}function vl(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var $l=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=gl,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",bl))),s("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(vl)}))}});var kl=String.raw`var{position:relative;cursor:pointer} +}`;function wl(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=rn(e.textContent),n=e.closest("section"),r=$l(e),s=[...n.querySelectorAll("var")].filter((e=>rn(e.textContent)===t&&e.closest("section")===n)),i=s[0].classList.contains("respec-hl");if(vl.set(r,i),i)return s.forEach((e=>kl(e,r))),[];s.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return s}(t),r=()=>{const e=$l(t);n.forEach((t=>kl(t,e))),[...vl.keys()].forEach((e=>vl.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const vl=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 $l(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===vl.get("respec-hl-c1")?"respec-hl-c1":[...vl.keys()].find((e=>vl.get(e)))||"respec-hl-c1"}function kl(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var xl=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=yl,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",wl))),s("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(kl)}))}});var _l=String.raw`var{position:relative;cursor:pointer} 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 xl=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=kl,document.head.appendChild(t);let n=null;const r=new Map,s=document.querySelectorAll("section var");for(const e of s){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 s=r.get(e.textContent.trim());s&&(e.dataset.type=s)}}});var _l=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var Cl=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(Nt`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=_l,document.head.appendChild(t)}});const Sl="core/anchor-expander";function Rl(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching element "${t}", but it has no title or marker.`,Sl,{title:"Missing title.",elements:[n]})}const s=$n(r);n.append(...s.childNodes),n.classList.add("box-ref")}function El(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Sl,{title:"Missing figcaption in referenced figure.",elements:[n]})}const s=[...$n(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...s),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=nn(i.textContent))}function Al(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Sl,{title:"Missing caption in referenced table.",elements:[n]})}const s=[...$n(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...s),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=nn(i.textContent))}function Tl(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Ll(r,n),Pl(r,n);else{n.textContent=n.getAttribute("href");Sn("Found matching section, but the section was lacking a heading element.",Sl,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Ll(e,t){const n=e.querySelector(".self-link"),r=[...$n(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=hn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Pl(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const s=t.closest(`[${n}]`);s&&s.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Il=Object.freeze({__proto__:null,name:Sl,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":Ll(n,t);break;case"section":Tl(n,e,t);break;case"figure":El(n,e,t);break;case"table":Al(n,e,t);break;case"aside":case"div":Rl(n,e,t);break;default:t.textContent=t.getAttribute("href");Sn("ReSpec doesn't support expanding this kind of reference.",Sl,{title:`Can't expand "#${e}".`,elements:[t]})}Pl(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Sn(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Sl,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Dl=String.raw`dfn{cursor:pointer} +var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Cl=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=_l,document.head.appendChild(t);let n=null;const r=new Map,s=document.querySelectorAll("section var");for(const e of s){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 s=r.get(e.textContent.trim());s&&(e.dataset.type=s)}}});var Sl=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var Rl=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(Ot`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=Sl,document.head.appendChild(t)}});const El="core/anchor-expander";function Al(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Rn(`Found matching element "${t}", but it has no title or marker.`,El,{title:"Missing title.",elements:[n]})}const s=kn(r);n.append(...s.childNodes),n.classList.add("box-ref")}function Tl(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Rn(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,El,{title:"Missing figcaption in referenced figure.",elements:[n]})}const s=[...kn(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...s),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=rn(i.textContent))}function Ll(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Rn(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,El,{title:"Missing caption in referenced table.",elements:[n]})}const s=[...kn(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...s),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=rn(i.textContent))}function Pl(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Il(r,n),Dl(r,n);else{n.textContent=n.getAttribute("href");Rn("Found matching section, but the section was lacking a heading element.",El,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Il(e,t){const n=e.querySelector(".self-link"),r=[...kn(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=mn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Dl(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const s=t.closest(`[${n}]`);s&&s.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Nl=Object.freeze({__proto__:null,name:El,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":Il(n,t);break;case"section":Pl(n,e,t);break;case"figure":Tl(n,e,t);break;case"table":Ll(n,e,t);break;case"aside":case"div":Al(n,e,t);break;default:t.textContent=t.getAttribute("href");Rn("ReSpec doesn't support expanding this kind of reference.",El,{title:`Can't expand "#${e}".`,elements:[t]})}Dl(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Rn(`Couldn't expand inline reference. The id "${e}" is not in the document.`,El,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Ol=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} @@ -1163,7 +1165,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var xl=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 Nl(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),s=`dfn-panel-for-${e.id}`,i=e.getAttribute("aria-label")||nn(e.textContent),o=Nt` +.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 jl(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),s=`dfn-panel-for-${e.id}`,i=e.getAttribute("aria-label")||rn(e.textContent),o=Ot` <div class="dfn-panel" id="${s}" @@ -1180,11 +1182,11 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var xl=Obje aria-label="Permalink for definition: ${i}. Activate to close this dialog." >Permalink</a > - ${function(e){return e.matches("dfn[data-export]")?Nt`<span + ${function(e){return e.matches("dfn[data-export]")?Ot`<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 Nt`<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 Ot`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -1192,41 +1194,41 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var xl=Obje >`}}return null}(e,r)} </div> <p><b>Referenced in:</b></p> - ${function(e,t){if(!t.length)return Nt`<ul> + ${function(e,t){if(!t.length)return Ot`<ul> <li>Not referenced in this document.</li> - </ul>`;const n=new Map;t.forEach(((t,r)=>{const s=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=s);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?`§ ${nn(n.textContent)}`:null}(t);(n.get(i)||n.set(i,[]).get(i)).push(s)}));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})))),s=e=>Nt`<li> - ${r(e).map((e=>Nt`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} - </li>`;return Nt`<ul> + </ul>`;const n=new Map;t.forEach(((t,r)=>{const s=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=s);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?`§ ${rn(n.textContent)}`:null}(t);(n.get(i)||n.set(i,[]).get(i)).push(s)}));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})))),s=e=>Ot`<li> + ${r(e).map((e=>Ot`<a href="#${e.id}" title="${e.title}">${e.text}</a>${" "}`))} + </li>`;return Ot`<ul> ${[...n].map(s)} </ul>`}(t,r)} </div> - `;return o}var Ol=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Nt`<style> - ${Dl} - </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(Nl(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 Uu}))).default}catch{return Xc("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const jl="rs-changelog",Ml=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;Nt.bind(this)` + `;return o}var Ml=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Ot`<style> + ${Ol} + </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(jl(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 Wu}))).default}catch{return el("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const zl="rs-changelog",Ul=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;Ot.bind(this)` <ul> - ${{any:zl(e,t,n).then((e=>async function(e){const{repoURL:t}=await vs;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,i=r&&Nt` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return Nt`<li><a href="${s}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>Sn(e.message,jl,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} + ${{any:ql(e,t,n).then((e=>async function(e){const{repoURL:t}=await ks;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,i=r&&Ot` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return Ot`<li><a href="${s}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>Rn(e.message,zl,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} </ul> - `}};async function zl(e,t,n){let r;try{const s=await vs;if(!s)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${s.apiBase}/${s.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const o=await fetch(i.href);if(!o.ok)throw new Error(`Request to ${i} failed with status code ${o.status}`);if(r=await o.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 Ul=[Object.freeze({__proto__:null,element:Ml,name:jl})];var ql=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ul.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ul.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Wl=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),s=n?"removeOnSave":null;document.head.append(Nt`<meta + `}};async function ql(e,t,n){let r;try{const s=await ks;if(!s)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${s.apiBase}/${s.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const o=await fetch(i.href);if(!o.ok)throw new Error(`Request to ${i} failed with status code ${o.status}`);if(r=await o.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 Wl=[Object.freeze({__proto__:null,element:Ul,name:zl})];var Fl=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Wl.forEach((e=>{customElements.define(e.name,e.element)}));const e=Wl.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Bl=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),s=n?"removeOnSave":null;document.head.append(Ot`<meta name="monetization" content="${r}" class="${s}" - />`)}});const Fl="core/before-save";var Bl=Object.freeze({__proto__:null,name:Fl,run:function(e){if(e.beforeSave)if(Array.isArray(e.beforeSave)&&!e.beforeSave.some((e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name)))s("beforesave",(t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){Sn(Pn`Function ${`\`${r.name}\``||`at position ${n}`}\` threw an error during processing of ${"[beforeSave]"}.`,Fl,{hint:"See developer console."}),console.error(e)}finally{n++}}(e.beforeSave,t.ownerDocument)}),{once:!0});else{Sn(Pn`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,Fl)}}});const Hl="core/linter-rules/check-charset",Gl=rn({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 Vl=Object.freeze({__proto__:null,name:Hl,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||Rn(Gl.msg,Hl,{hint:Gl.hint,elements:[...t]})}});const Yl="core/linter-rules/check-punctuation",Kl=[".",":","!","?"],Zl=rn({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Kl.map((e=>`"${e}"`)).join(", ")}.`}});var Jl=Object.freeze({__proto__:null,name:Yl,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Kl.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Rn(Zl.msg,Yl,{hint:Zl.hint,elements:n})}});const Xl="core/linter-rules/check-internal-slots",Ql=rn({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var eu=Object.freeze({__proto__:null,name:Xl,run:function(e){if(!e.lint?.["check-internal-slots"])return;const t=[...document.querySelectorAll("var+a")].filter((({previousSibling:{nodeName:e}})=>e&&"VAR"===e));t.length&&Rn(Ql.msg,Xl,{hint:Ql.hint,elements:t})}});const tu="core/linter-rules/local-refs-exist",nu=rn({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function ru(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var su=Object.freeze({__proto__:null,name:tu,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(ru);t.length&&Rn(nu.msg,tu,{hint:nu.hint,elements:t})}});const iu="core/linter-rules/no-captionless-tables",ou=rn({en:{msg:"All tables marked with class='numbered' must start with a caption element.",hint:"Add a `caption` to the offending table."}});var au=Object.freeze({__proto__:null,name:iu,run:function(e){if(!e.lint?.["no-captionless-tables"])return;const t=[...document.querySelectorAll("table.numbered")].filter((e=>!(e.firstElementChild instanceof HTMLTableCaptionElement)));t.length&&Rn(ou.msg,iu,{hint:ou.hint,elements:t})}});const cu="no-unused-dfns",lu="core/linter-rules/no-unused-dfns",uu=rn({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return Pn` + />`)}});const Hl="core/before-save";var Gl=Object.freeze({__proto__:null,name:Hl,run:function(e){if(e.beforeSave)if(Array.isArray(e.beforeSave)&&!e.beforeSave.some((e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name)))s("beforesave",(t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){Rn(In`Function ${`\`${r.name}\``||`at position ${n}`}\` threw an error during processing of ${"[beforeSave]"}.`,Hl,{hint:"See developer console."}),console.error(e)}finally{n++}}(e.beforeSave,t.ownerDocument)}),{once:!0});else{Rn(In`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,Hl)}}});const Vl="core/linter-rules/check-charset",Yl=sn({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 Kl=Object.freeze({__proto__:null,name:Vl,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||En(Yl.msg,Vl,{hint:Yl.hint,elements:[...t]})}});const Zl="core/linter-rules/check-punctuation",Jl=[".",":","!","?"],Xl=sn({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Jl.map((e=>`"${e}"`)).join(", ")}.`}});var Ql=Object.freeze({__proto__:null,name:Zl,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Jl.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&En(Xl.msg,Zl,{hint:Xl.hint,elements:n})}});const eu="core/linter-rules/check-internal-slots",tu=sn({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var nu=Object.freeze({__proto__:null,name:eu,run:function(e){if(!e.lint?.["check-internal-slots"])return;const t=[...document.querySelectorAll("var+a")].filter((({previousSibling:{nodeName:e}})=>e&&"VAR"===e));t.length&&En(tu.msg,eu,{hint:tu.hint,elements:t})}});const ru="core/linter-rules/local-refs-exist",su=sn({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function iu(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var ou=Object.freeze({__proto__:null,name:ru,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(iu);t.length&&En(su.msg,ru,{hint:su.hint,elements:t})}});const au="core/linter-rules/no-captionless-tables",cu=sn({en:{msg:"All tables marked with class='numbered' must start with a caption element.",hint:"Add a `caption` to the offending table."}});var lu=Object.freeze({__proto__:null,name:au,run:function(e){if(!e.lint?.["no-captionless-tables"])return;const t=[...document.querySelectorAll("table.numbered")].filter((e=>!(e.firstElementChild instanceof HTMLTableCaptionElement)));t.length&&En(cu.msg,au,{hint:cu.hint,elements:t})}});const uu="no-unused-dfns",du="core/linter-rules/no-unused-dfns",pu=sn({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return In` You can do one of the following... * Add a \`class="lint-ignore"\` attribute the definition. * Either remove the definition or change \`<dfn>\` to another type of HTML element. * If you meant to ${"[export|#data-export]"} the definition, add \`class="export"\` to the definition. - To silence this warning entirely, set \`lint: { "no-unused-dfns": false }\` in your \`respecConfig\`.`}}});function du(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var pu=Object.freeze({__proto__:null,name:lu,run:function(e){if(!e.lint?.[cu])return;const t="error"===e.lint[cu]?Sn:Rn;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(du).forEach((e=>{const n=[e],r=nn(e.textContent);t(uu.msg(r),lu,{elements:n,hint:uu.hint})}))}});const fu="core/linter-rules/no-headingless-sections",hu=rn({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 mu=Object.freeze({__proto__:null,name:fu,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&&Rn(hu.msg,fu,{hint:hu.hint,elements:t})}});const gu="core/linter-rules/no-unused-vars",bu=rn({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var yu=Object.freeze({__proto__:null,name:gu,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 s=new Map;for(const e of r){const t=nn(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Rn(bu.msg,gu,{hint:bu.hint,elements:t})}});const wu="required-sections",vu="w3c/linter-rules/required-sections",$u={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>Pn`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). + To silence this warning entirely, set \`lint: { "no-unused-dfns": false }\` in your \`respecConfig\`.`}}});function fu(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var hu=Object.freeze({__proto__:null,name:du,run:function(e){if(!e.lint?.[uu])return;const t="error"===e.lint[uu]?Rn:En;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(fu).forEach((e=>{const n=[e],r=rn(e.textContent);t(pu.msg(r),du,{elements:n,hint:pu.hint})}))}});const mu="core/linter-rules/no-headingless-sections",gu=sn({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 bu=Object.freeze({__proto__:null,name:mu,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&&En(gu.msg,mu,{hint:gu.hint,elements:t})}});const yu="core/linter-rules/no-unused-vars",wu=sn({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var vu=Object.freeze({__proto__:null,name:yu,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 s=new Map;for(const e of r){const t=rn(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&En(wu.msg,yu,{hint:wu.hint,elements:t})}});const $u="required-sections",ku="w3c/linter-rules/required-sections",xu={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>In`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). If the document is not intended for the W3C Recommendation track, set ${"[noRecTrack]"} to \`true\` - or turn off the ${`[${wu}]`} linter rule.`,privacy_considerations:"Privacy Considerations",security_considerations:"Security Considerations"},es:{msg:e=>`Documentos que van a ser "W3C Recommendation" requieren una sección "${e}" separada.`,hint:e=>Pn`Agrega una \`<section>\` con título "${e}". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). + or turn off the ${`[${$u}]`} linter rule.`,privacy_considerations:"Privacy Considerations",security_considerations:"Security Considerations"},es:{msg:e=>`Documentos que van a ser "W3C Recommendation" requieren una sección "${e}" separada.`,hint:e=>In`Agrega una \`<section>\` con título "${e}". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). Si el documento no está destinado a ser un W3C Recommendation, puedes poner ${"[noRecTrack]"} a \`true\` - o apaga la regla de linter ${`[${wu}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"}},ku=rn($u),xu=new Set([...Gr]);xu.delete("DISC"),Hr.forEach((e=>xu.delete(e)));var _u=Object.freeze({__proto__:null,name:vu,requiresSomeSectionStatus:xu,run:function(e){if(!e.lint?.[wu])return;if(!sn($u,"privacy_considerations")){return void Rn("Cannot check for required sections as translations are not available.",vu,{hint:"File an issue to add translations or use a supported language."})}if(e.noRecTrack||!xu.has(e.specStatus))return;const t="error"===e.lint[wu]?Sn:Rn,n=new vn([ku.privacy_considerations,ku.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi")?.forEach((e=>e.remove()));const r=nn(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(ku.msg(e),vu,{hint:ku.hint(e)})}});const Cu="core/linter-rules/wpt-tests-exist",Su=rn({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."}});var Ru=Object.freeze({__proto__:null,name:Cu,run:async function(e){if(!e.lint?.["wpt-tests-exist"])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return Rn("Failed to parse WPT directory from testSuiteURI",`linter/${Cu}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return Rn(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,`linter/${Cu}`),null}const{entries:i}=await s.json(),o=i.filter((e=>!e.endsWith("/")));return new Set(o)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));for(const e of n)e.dataset.tests.split(/,/gm).map((e=>e.trim().split("#")[0])).filter((e=>e&&!t.has(e))).map((t=>{Rn(`${Su.msg} \`${t}\`.`,Cu,{hint:Su.hint,elements:[e]})}))}});const Eu="core/linter-rules/no-http-props",Au=rn({en:{msg:Pn`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Pn`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var Tu=Object.freeze({__proto__:null,name:Eu,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=Qt(t,(e=>Pn`${`[${e}]`}`));Rn(Au.msg,Eu,{hint:Au.hint+e})}}});const Lu="core/linter-rules/a11y",Pu=["color-contrast","landmark-one-main","landmark-unique","region"];function Iu(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map((e=>`- ${e.trimEnd()}`)).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var Du=Object.freeze({__proto__:null,name:Lu,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(Pu.map((e=>[e,{enabled:!1}]))),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://unpkg.com/axe-core@4/axe.min.js",document.head.appendChild(e),new Promise(((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n}))}()}catch(e){return Sn("Failed to load a11y linter.",Lu),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return Sn("Error while looking for a11y issues.",Lu),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:i}=e,o=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=Iu(e);Rn(o,Lu,{details:`\n\n${s}.\n\n${t}. ([Learn more](${i}))`,elements:n})}}}});const Nu="informative-dfn",Ou="core/linter-rules/informative-dfn",ju=rn({en:{msg:(e,t)=>`Normative reference to "${e}" found but term is defined "informatively" in "${t}".`,get hint(){return Pn` + o apaga la regla de linter ${`[${$u}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"}},_u=sn(xu),Cu=new Set([...Yr]);Cu.delete("DISC"),Vr.forEach((e=>Cu.delete(e)));var Su=Object.freeze({__proto__:null,name:ku,requiresSomeSectionStatus:Cu,run:function(e){if(!e.lint?.[$u])return;if(!on(xu,"privacy_considerations")){return void En("Cannot check for required sections as translations are not available.",ku,{hint:"File an issue to add translations or use a supported language."})}if(e.noRecTrack||!Cu.has(e.specStatus))return;const t="error"===e.lint[$u]?Rn:En,n=new $n([_u.privacy_considerations,_u.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi")?.forEach((e=>e.remove()));const r=rn(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(_u.msg(e),ku,{hint:_u.hint(e)})}});const Ru="core/linter-rules/wpt-tests-exist",Eu=sn({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."}});var Au=Object.freeze({__proto__:null,name:Ru,run:async function(e){if(!e.lint?.["wpt-tests-exist"])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return En("Failed to parse WPT directory from testSuiteURI",`linter/${Ru}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return En(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,`linter/${Ru}`),null}const{entries:i}=await s.json(),o=i.filter((e=>!e.endsWith("/")));return new Set(o)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));for(const e of n)e.dataset.tests.split(/,/gm).map((e=>e.trim().split("#")[0])).filter((e=>e&&!t.has(e))).map((t=>{En(`${Eu.msg} \`${t}\`.`,Ru,{hint:Eu.hint,elements:[e]})}))}});const Tu="core/linter-rules/no-http-props",Lu=sn({en:{msg:In`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:In`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var Pu=Object.freeze({__proto__:null,name:Tu,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=en(t,(e=>In`${`[${e}]`}`));En(Lu.msg,Tu,{hint:Lu.hint+e})}}});const Iu="core/linter-rules/a11y",Du=["color-contrast","landmark-one-main","landmark-unique","region"];function Nu(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map((e=>`- ${e.trimEnd()}`)).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var Ou=Object.freeze({__proto__:null,name:Iu,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(Du.map((e=>[e,{enabled:!1}]))),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://unpkg.com/axe-core@4/axe.min.js",document.head.appendChild(e),new Promise(((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n}))}()}catch(e){return Rn("Failed to load a11y linter.",Iu),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return Rn("Error while looking for a11y issues.",Iu),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:i}=e,o=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=Nu(e);En(o,Iu,{details:`\n\n${s}.\n\n${t}. ([Learn more](${i}))`,elements:n})}}}});const ju="informative-dfn",Mu="core/linter-rules/informative-dfn",zu=sn({en:{msg:(e,t)=>`Normative reference to "${e}" found but term is defined "informatively" in "${t}".`,get hint(){return In` You can do one of the following... * Get the source definition to be made normative * Add a \`class="lint-ignore"\` attribute to the link. * Use a local normative proxy for the definition à la \`<dfn data-cite="spec">term</dfn>\` - To silence this warning entirely, set \`lint: { "${Nu}": false }\` in your \`respecConfig\`.`}}});var Mu=Object.freeze({__proto__:null,name:Ou,run:function(e){if(!e.lint?.[Nu])return;const t="error"===e.lint[Nu]?Sn:Rn;Aa.forEach((({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(ju.msg(e,n),Ou,{title:"Normative reference to non-normative term.",elements:[r],hint:ju.hint})}))}}),zu=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'}),Uu=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})()'})}(); + To silence this warning entirely, set \`lint: { "${ju}": false }\` in your \`respecConfig\`.`}}});var Uu=Object.freeze({__proto__:null,name:Mu,run:function(e){if(!e.lint?.[ju])return;const t="error"===e.lint[ju]?Rn:En;La.forEach((({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(zu.msg(e,n),Mu,{title:"Normative reference to non-normative term.",elements:[r],hint:zu.hint})}))}}),qu=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'}),Wu=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-w3c.js.map diff --git a/builds/respec-w3c.js.map b/builds/respec-w3c.js.map index 5ffbe42b81..251d54bbbf 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.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 \"Member-SUBM\": \"SUBM\",\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 case \"MEMBER-SUBM\":\n styleFile = \"W3C-Member-SUBM\";\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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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,UA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ED,MAAM5oB,GAAEA,EAAE0qE,KAAEA,EAAIpL,YAAEA,EAAWqL,QAAEA,GAAYL,EACrC3kE,EAAQ,QAAQ3F,MAAO0qE,KAC7B,IAAK,MAAOD,EAAgBx/C,KAAas/C,EAAkB,CACzD,MAAMK,EAAQlB,GAAsBe,GAEpC/kD,GAAY/f,EAAOpiB,GAAM,CAAE4nC,QADX,OAAOm0C,SAAmBsL,oBAAwBD,MAC9B1/C,YACrC,CACF,CACH,ICtCA,MAAMt/B,GAAW,kBACJpI,GAAO,oCAmBdgC,GAAOu/B,GAjBe,CAC1Br/B,GAAI,CACF0rB,IAAG,CAAC28C,EAAM7R,IACD,2BAA2B6R,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 +{"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 getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\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 pluralize$1 = {exports: {}};\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 pluralizeExports = pluralize$1.exports;\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(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, htmlJoinAnd } 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 endorsement = html`${conf.textStatus}s are not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> nor its Members.`;\n break;\n case \"NOTE\":\n endorsement = html`This ${conf.textStatus} is endorsed by\n ${getWgHTML(conf)}, but is not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> itself nor its\n 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 ${getWgHTML(conf)} as\n ${prefix(conf.longStatus)}${track}. ${changes}\n </p>`;\n}\n\nfunction getWgHTML(conf) {\n if (Array.isArray(conf.wg)) {\n return htmlJoinAnd(conf.wg, (wg, idx) => {\n return html`the <a href=\"${conf.wgURI[idx]}\">${wg}</a>`;\n });\n } else if (conf.wg) {\n return html`the <a href=\"${conf.wgURI}\">${conf.wg}</a>`;\n }\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 \"Member-SUBM\": \"SUBM\",\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.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 }\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 case \"MEMBER-SUBM\":\n styleFile = \"W3C-Member-SUBM\";\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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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","getDefaultExportFromCjs","__esModule","module","pluralize$1","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","getWgHTML","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","idx","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","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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,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.json b/package.json index 8f11f73781..71b8bde2ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "respec", - "version": "33.0.2", + "version": "33.0.3", "license": "W3C", "description": "A technical specification pre-processor.", "engines": {