respec 37.4.1 → 37.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- window.respecVersion="37.4.1",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=document.documentElement;t?.hasAttribute("lang")||(t.lang="en",t.hasAttribute("dir")||(t.dir="ltr"));const n={},r=t?.lang??"en";var o=Object.freeze({__proto__:null,l10n:n,lang:r,name:"core/l10n",run:function(e){e.l10n=n[r]||n.en}});const s=(e,t)=>t.some((t=>e instanceof t));let i,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap;let d={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return m(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){d=e(d)}function h(e){return(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(g(this),t),m(this.request)}:function(...t){return m(e.apply(g(this),t))}}function f(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(l.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)}));l.set(e,t)}(e),s(e,i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,d):e)}function m(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(m(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return u.set(t,e),t}(e);if(c.has(e))return c.get(e);const t=f(e);return t!==e&&(c.set(e,t),u.set(t,e)),t}const g=e=>u.get(e);const b=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],w=new Map;function v(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(w.get(t))return w.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!b.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 w.set(t,s),s}p((e=>({...e,get:(t,n,r)=>v(t,n)||e.get(t,n,r),has:(t,n)=>!!v(t,n)||e.has(t,n)})));const k=["continue","continuePrimaryKey","advance"],x={},$=new WeakMap,E=new WeakMap,S={get(e,t){if(!k.includes(t))return e[t];let n=x[t];return n||(n=x[t]=function(...e){$.set(this,E.get(this)[t](...e))}),n}};async function*_(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,S);for(E.set(n,t),u.set(n,g(t));t;)yield n,t=await($.get(n)||t.continue()),$.delete(n)}function C(e,t){return t===Symbol.asyncIterator&&s(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&s(e,[IDBIndex,IDBObjectStore])}p((e=>({...e,get:(t,n,r)=>C(t,n)?_:e.get(t,n,r),has:(t,n)=>C(t,n)||e.has(t,n)})));var L,A=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),m(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=m(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(m(i.result),e.oldVersion,e.newVersion,m(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:g,wrap:m});!function(e){e.ILLEGAL="ILLEGAL",e.EOF="EOF",e.NL="\n",e.SPACE=" ",e.UNDERSCORE="_",e.DOLLAR="$",e.ATSIGN="@",e.CARET="^",e.HASH="#",e.TILDE="~",e.AMPERSAND="&",e.IDENT="IDENT",e.COMMENT="COMMENT",e.STRING="STRING",e.NUMBER="NUMBER",e.FLOAT="FLOAT",e.CTLOP="CTLOP",e.BYTES="BYTES",e.HEX="HEX",e.BASE64="BASE64",e.ASSIGN="=",e.ARROWMAP="=>",e.TCHOICE="/",e.GCHOICE="//",e.TCHOICEALT="/=",e.GCHOICEALT="//=",e.PLUS="+",e.MINUS="-",e.QUEST="?",e.ASTERISK="*",e.INCLRANGE="..",e.EXCLRANGE="...",e.COMMA=",",e.DOT=".",e.COLON=":",e.SEMICOLON=";",e.LPAREN="(",e.RPAREN=")",e.LBRACE="{",e.RBRACE="}",e.LBRACK="[",e.RBRACK="]",e.LT="<",e.GT=">",e.QUOT='"'}(L||(L={}));const T=Object.entries(L).reduce(((e,[t,n])=>(e[n]=t,e)),{});new class{type;literal;comments;whitespace;constructor(e,t,n=[],r=""){this.type=e,this.literal=t,this.comments=n,this.whitespace=r}serialize(){let e="";for(const t of this.comments)e+=t.serialize();switch(e+=this.whitespace,this.type){case L.IDENT:case L.COMMENT:case L.NUMBER:case L.FLOAT:e+=this.literal;break;case L.STRING:e+='"'+this.literal+'"';break;case L.CTLOP:e+="."+this.literal;break;case L.BYTES:e+="'"+this.literal+"'";break;case L.HEX:e+="h'"+this.literal+"'";break;case L.BASE64:e+="b64'"+this.literal+"'";break;case L.EOF:break;default:e+=this.type.valueOf()}return e}startWithSpaces(){return""!==this.whitespace||this.comments.length>0}toString(e=0){const t=[`${" ".repeat(e)}${this.constructor.name}: ${T[this.type]} (${this.type})`];""!==this.whitespace&&t.push(" ".repeat(e+1)+`whitespaces: ${this.whitespace.length}`),""!==this.literal&&t.push(" ".repeat(e+1)+`literal: ${this.literal}`);for(const n of this.comments)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return{type:this.type,literal:this.literal,comments:this.comments?.map((e=>e.toJSON())),whitespace:this.whitespace}}}(L.ILLEGAL,"");const R=/^[!#$%&'*+-.^`|~\w]+$/,N=/[\u000A\u000D\u0009\u0020]/u,O=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function P(e,t,n){(t&&""!==t&&!e.has(t)&&O.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function I(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var j={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function D(e){j=e}var z={exec:()=>null};function M(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),o=t[r];return o||(o=e(r),t[r]=o),o}}function q(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(B.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var H=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),B={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:M((e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`))),hrRegex:M((e=>new RegExp(`^ {0,${e}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\*[ \t]*){3,})(?:\\n+|$)`))),fencesBeginRegex:M((e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`))),headingBeginRegex:M((e=>new RegExp(`^ {0,${e}}#`))),htmlBeginRegex:M((e=>new RegExp(`^ {0,${e}}(?:</?(?:${X})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i"))),blockquoteBeginRegex:M((e=>new RegExp(`^ {0,${e}}>`)))},F=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,U=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,W=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,G=q(W).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),V=q(W).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Z=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Y=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,K=q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Y).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Q=q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,U).getRegex(),X="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",J=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ee=q("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",J).replace("tag",X).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),te=e=>q(Z).replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",X).getRegex(),ne=te(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),re=te(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),oe={blockquote:q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",re).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:K,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:F,html:ee,lheading:G,list:Q,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:ne,table:z,text:/^[^\n]+/},se=q("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",X).getRegex(),ie={...oe,lheading:V,table:se,paragraph:q(Z).replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",se).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",X).getRegex()},ae={...oe,html:q("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",J).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:z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q(Z).replace("hr",F).replace("heading"," *#{1,6} *[^\n]").replace("lheading",G).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},le=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ce=/[\p{P}\p{S}]/u,ue=/[\s\p{P}\p{S}]/u,de=/[^\s\p{P}\p{S}]/u,pe=q(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ue).getRegex(),he=/(?!~)[\p{P}\p{S}]/u,fe=q(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",H?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),me=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ge=q(me,"u").replace(/punct/g,ce).getRegex(),be=q(me,"u").replace(/punct/g,he).getRegex(),ye=q(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,"u").replace(/openQuote/g,/[\p{Pi}\p{Ps}"']/u).replace(/punct/g,ce).getRegex(),we="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ve=q(we,"gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),ke=q(we,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,he).getRegex(),xe=q("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),$e=q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),Ee=q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),Se=q(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ce).getRegex(),_e=q("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),Ce=q(/\\(punct)/,"gu").replace(/punct/g,ce).getRegex(),Le=q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),Ae=q(J).replace("(?:--\x3e|$)","--\x3e").getRegex(),Te=q("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ae).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Re=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Ne=q(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Re).getRegex(),Oe=q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ne).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Pe=q(/^!?\[(label)\]\[(ref)\]/).replace("label",Ne).replace("ref",Y).getRegex(),Ie=q(/^!?\[(ref)\](?:\[\])?/).replace("ref",Y).getRegex(),je=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,De=q(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Re).getRegex(),ze=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Me={_backpedal:z,anyPunctuation:Ce,autolink:Le,blockSkip:fe,br:le,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:z,delLDelim:z,delRDelim:z,emStrongLDelim:ge,emStrongRDelimAst:ve,emStrongRDelimUnd:$e,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Oe,nolink:Ie,punctuation:pe,reflink:Pe,reflinkSearch:q("reflink|nolink(?!\\()","g").replace("reflink",q(/^!?\[(label)\]\[(ref)\]/).replace("label",De).replace("ref",je).getRegex()).replace("nolink",q(/^!?\[(ref)\](?:\[\])?/).replace("ref",je).getRegex()).getRegex(),tag:Te,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:z},qe={...Me,emStrongLDelim:ye,emStrongRDelimAst:xe,emStrongRDelimUnd:Ee,link:q(/^!?\[(label)\]\((.*?)\)/).replace("label",Ne).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ne).getRegex()},He={...Me,emStrongRDelimAst:ke,emStrongLDelim:be,delLDelim:Se,delRDelim:_e,url:q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ze).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:q(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ze).getRegex()},Be={...He,br:q(le).replace("{2,}","*").getRegex(),text:q(He.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Fe={normal:oe,gfm:ie,pedantic:ae},Ue={normal:Me,gfm:He,breaks:Be,pedantic:qe},We={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ge=e=>We[e];function Ve(e,t){if(t){if(B.escapeTest.test(e))return e.replace(B.escapeReplace,Ge)}else if(B.escapeTestNoEncode.test(e))return e.replace(B.escapeReplaceNoEncode,Ge);return e}function Ze(e){try{e=encodeURI(e).replace(B.percentDecode,"%")}catch{return null}return e}function Ye(e,t){let n=e.replace(B.findPipe,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(B.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(B.slashPipe,"|");return n}function Ke(e,t,n){let r=e.length;if(0===r)return"";let o=0;for(;o<r;){if(e.charAt(r-o-1)!==t)break;o++}return e.slice(0,r-o)}function Qe(e){let t=e.split("\n"),n=t.length-1;for(;n>=0&&B.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join("\n")}function Xe(e){return e.toLowerCase().toUpperCase().toLowerCase()}function Je(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function et(e,t,n,r,o){let s=t.href,i=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1"),l="!"===e[0].charAt(0);r.state.inLink=!0;let c=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(a),p=r.state.linkEmitted;if(r.state.linkEmitted=c,r.state.inLink=!1,!l){if(p)return void(r.state.inRawBlock=u);r.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:s,title:i,text:a,tokens:d}}function tt(e,t,n,r){if(!t.includes("<"))return!1;for(let o=0;o<t.length;o++){if("\\"===t[o]){o++;continue}if("`"===t[o]){let e=r.inline.code.exec(t.slice(o));if(e){o+=e[0].length-1;continue}}if("<"!==t[o])continue;let s=e.slice(n+o),i=r.inline.tag.exec(s)||r.inline.autolink.exec(s);if(i){if(i[0].length>t.length-o)return!0;o+=i[0].length-1}}return!1}var nt=class{options;rules;lexer;constructor(e){this.options=e||j}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Qe(t[0]),n=e.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let o=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return e.slice(Math.min(r.length,o.length))})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Ke(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:"heading",raw:Ke(t[0],"\n"),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ke(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ke(t[0],"\n").split("\n"),n="",r="",o=[];for(;e.length>0;){let t,s=!1,i=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))i.push(e[t]),s=!0;else{if(s)break;i.push(e[t])}e=e.slice(t);let a=i.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=c,0===e.length)break;let u=o.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,s=e.join("\n"),i=t.raw+"\n"+s.replace(this.rules.other.blockquoteSetextReplace2,""),a=this.blockquote(i);o[o.length-1]=a,n=`${n}\n${s}`,r=r.substring(0,r.length-t.text.length)+a.text;break}if("list"!==u?.type);else{let t=u,s=t.raw+"\n"+e.join("\n"),i=this.list(s);o[o.length-1]=i,n=n.substring(0,n.length-u.raw.length)+i.raw,r=r.substring(0,r.length-t.raw.length)+i.raw,e=s.substring(o.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),i=!1;for(;e;){let n=!1,r="",a="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=Je(t[2].split("\n",1)[0],t[1].length),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,a=l.trimStart()):u?d=t[1].length+1:(d=l.search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),o=this.rules.other.fencesBeginRegex(d),s=this.rules.other.headingBeginRegex(d),i=this.rules.other.htmlBeginRegex(d),p=this.rules.other.blockquoteBeginRegex(d);for(;e;){let h,f=e.split("\n",1)[0];if(c=f,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),o.test(c)||s.test(c)||i.test(c)||p.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())a+="\n"+h.slice(d);else{if(u||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||o.test(l)||s.test(l)||n.test(l))break;a+="\n"+c}u=!c.trim(),r+=f+"\n",e=e.substring(f.length+1),l=h.slice(d)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(i=!0)),o.items.push({type:"list_item",raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]}),o.raw+=r}let a=o.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),o.raw=o.raw.trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));o.loose=n}for(let e of o.items){let t=e.tokens[0];if(!e.task||"text"!==t?.type&&"paragraph"!==t?.type)e.task&&(e.task=!1);else{e.text=e.text.replace(this.rules.other.listReplaceTask,""),t.raw=t.raw.replace(this.rules.other.listReplaceTask,""),t.text=t.text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:"checkbox",raw:n[0]+" ",checked:"[ ]"!==n[0]};e.checked=t.checked,o.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:"paragraph",raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Qe(t[0]);return{type:"html",block:!0,raw:e,pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=Xe(t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:Ke(t[0],"\n"),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ye(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:Ke(t[0],"\n"),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of o)s.rows.push(Ye(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:Ke(t[0],"\n"),depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let 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){let 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){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n="!"===t[0].charAt(0)?2:1;if(!this.options.pedantic&&tt(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Ke(r.slice(0,-1),"\\");if((r.length-e.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let 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 o=t[2],s="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(o);e&&(o=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(o=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o.slice(1):o.slice(1,-1)),et(t,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&tt(e,n[1],r,this.rules))return;let o=t[Xe((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "))];if(!o){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return et(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(r[1]||r[2]||r[3]||r[4])&&(!r[4]||!n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[3]||!n||this.rules.inline.punctuation.exec(n))){let o,s,i=[...r[0]].length-1,a=i,l=0,c=r[0][0],u=n===c,d="*"===c?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);null!==(r=d.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]){a+=s;continue}if(r[5]||r[6]){if(i%3&&!((i+s)%3)){l+=s;continue}if(u)break}if(a-=s,a>0)continue;s=Math.min(s,s+a+l);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+s);if(Math.min(i,s)%2){let e=n.slice(1,-1);return{type:"em",raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let c=n.slice(2,-2);return{type:"strong",raw:n,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,o,s=[...r[0]].length-1,i=s,a=this.rules.inline.delRDelim;for(a.lastIndex=0,t=t.slice(-1*e.length+s);null!==(r=a.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==s))continue;if(r[3]||r[4]){i+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i);let t=[...r[0]][0].length,a=e.slice(0,s+r.index+t+o),l=a.slice(s,-s);return{type:"del",raw:a,text:l,tokens:this.lexer.inlineTokens(l)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},rt=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||j,this.options.tokenizer=this.options.tokenizer||new nt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:B,block:Fe.normal,inline:Ue.normal};this.options.pedantic?(t.block=Fe.pedantic,t.inline=Ue.pedantic):this.options.gfm&&(t.block=Fe.gfm,this.options.breaks?t.inline=Ue.breaks:t.inline=Ue.gfm),this.tokenizer.rules=t}static get rules(){return{block:Fe,inline:Ue}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(B.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(B.tabCharGlobal," ").replace(B.spaceLine,""));let r=1/0;for(;e;){if(!(e.length<r)){this.infiniteLoopError(e.charCodeAt(0));break}let o;if(r=e.length,this.options.extensions?.block?.some((n=>!!(o=n.call({lexer:this},e,t))&&(e=e.substring(o.raw.length),t.push(o),!0))))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let n=t.at(-1);1===o.raw.length&&void 0!==n?n.raw+="\n":t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+o.raw,n.text+="\n"+o.text,this.inlineQueue.at(-1).src=n.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+o.raw,n.text+="\n"+o.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},t.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let r=t.at(-1);n&&"paragraph"===r?.type?(r.raw+=(r.raw.endsWith("\n")?"":"\n")+o.raw,r.text+="\n"+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(o),n=s.length!==e.length,e=e.substring(o.raw.length)}else if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+o.raw,n.text+="\n"+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&"!"!==e.charAt(n.index-1))return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf("[");if("!"!==e.charAt(0)&&Object.hasOwn(this.tokens.links,Xe(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes("[")){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Xe(n.slice(r+1,-1))))return n;if(r>1&&"!"!==n.charAt(0)){let o=n.slice(1,r-1);if(this.linkInText(o))return"["+o.replace(e,t)+"]["+"a".repeat(n.length-r-2)+"]"}return"["+"a".repeat(n.length-2)+"]"};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,(e=>"+".repeat(e.length))),n=n.replace(this.tokenizer.rules.inline.blockSkip,((e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+"["+"a".repeat(e.length-r-2)+"]"})),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,o="",s=1/0;for(;e;){if(!(e.length<s)){this.infiniteLoopError(e.charCodeAt(0));break}let i;if(s=e.length,r||(o=""),r=!1,this.options.extensions?.inline?.some((n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0))))continue;if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length);let n=t.at(-1);"text"===i.type&&"text"===n?.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,n,o)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e,n,o)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(a=e.substring(0,n+1))}if(i=this.tokenizer.inlineText(a)){e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(o=i.raw.slice(-1)),r=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=i.raw,n.text+=i.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(!this.options.silent)throw new Error(t);console.error(t)}},ot=class{options;parser;constructor(e){this.options=e||j}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(B.notSpaceStart)?.[0],o=e?e.replace(B.endingNewline,"")+"\n":"";return r?'<pre><code class="language-'+Ve(r)+'">'+(n?o:Ve(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:Ve(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let o=e.rows[t];n="";for(let e=0;e<o.length;e++)n+=this.tablecell(o[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ve(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:o}){let s=o?Ve(n,!0):this.parser.parseInline(r),i=Ze(e);if(null===i)return s;let a='<a href="'+(e=Ve(i,o))+'"';return t&&(a+=' title="'+Ve(t)+'"'),a+=">"+s+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=Ze(e);if(null===o)return Ve(n);let s=`<img src="${Ve(e=o)}" alt="${Ve(n)}"`;return t&&(s+=` title="${Ve(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ve(e.text)}},st=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},it=class e{options;renderer;textRenderer;constructor(e){this.options=e||j,this.options.renderer=this.options.renderer||new ot,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new st}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(e.type)){t+=n||"";continue}}let o=r;switch(o.type){case"space":t+=this.renderer.space(o);break;case"hr":t+=this.renderer.hr(o);break;case"heading":t+=this.renderer.heading(o);break;case"code":t+=this.renderer.code(o);break;case"table":t+=this.renderer.table(o);break;case"blockquote":t+=this.renderer.blockquote(o);break;case"list":t+=this.renderer.list(o);break;case"checkbox":t+=this.renderer.checkbox(o);break;case"html":t+=this.renderer.html(o);break;case"def":t+=this.renderer.def(o);break;case"paragraph":t+=this.renderer.paragraph(o);break;case"text":t+=this.renderer.text(o);break;default:{let e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions?.renderers?.[o.type]){let e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}let s=o;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"checkbox":n+=t.checkbox(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},at=class{options;block;constructor(e){this.options=e||j}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?rt.lex:rt.lexInline}provideParser(e=this.block){return e?it.parse:it.parseInline}},lt=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=it;Renderer=ot;TextRenderer=st;Lexer=rt;Tokenizer=nt;Hooks=at;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let 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("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.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]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ot(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,o=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new nt(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,o=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new at;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,o=e.hooks[r],s=t[r];at.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&at.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await o.call(t,e);return s.call(t,n)})();let r=o.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await o.apply(t,e);return!1===n&&(n=await s.apply(t,e)),n})();let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return rt.lex(e,t??this.defaults)}parser(e,t){return it.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},s=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(t):t,r=await(o.hooks?await o.hooks.provideLexer(e):e?rt.lex:rt.lexInline)(n,o),s=o.hooks?await o.hooks.processAllTokens(r):r;o.walkTokens&&await Promise.all(this.walkTokens(s,o.walkTokens));let i=await(o.hooks?await o.hooks.provideParser(e):e?it.parse:it.parseInline)(s,o);return o.hooks?await o.hooks.postprocess(i):i})().catch(s);try{o.hooks&&(t=o.hooks.preprocess(t));let n=(o.hooks?o.hooks.provideLexer(e):e?rt.lex:rt.lexInline)(t,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let r=(o.hooks?o.hooks.provideParser(e):e?it.parse:it.parseInline)(n,o);return o.hooks&&(r=o.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Ve(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ct(e,t){return lt.parse(e,t)}function ut(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ct.options=ct.setOptions=function(e){return lt.setOptions(e),ct.defaults=lt.defaults,D(ct.defaults),ct},ct.getDefaults=I,ct.defaults=j,ct.use=function(...e){return lt.use(...e),ct.defaults=lt.defaults,D(ct.defaults),ct},ct.walkTokens=function(e,t){return lt.walkTokens(e,t)},ct.parseInline=lt.parseInline,ct.Parser=it,ct.parser=it.parse,ct.Renderer=ot,ct.TextRenderer=st,ct.Lexer=rt,ct.lexer=rt.lex,ct.Tokenizer=nt,ct.Hooks=at,ct.parse=ct,ct.options,ct.setOptions,ct.walkTokens,ct.parseInline,it.parse,rt.lex;var dt,pt={exports:{}};var ht,ft=(dt||(dt=1,ht=pt,function(e,t){ht.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(t[0],(function(n,r){var o,s,a=(o=t[1],s=arguments,o.replace(/\$(\d{1,2})/g,(function(e,t){return s[t]||""})));return i(""===n?e[r-1]:n,a)}))}function l(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 a(t,s)}return t}function c(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):l(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&l(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=c(o,r,e),d.isPlural=u(o,r,e),d.singular=c(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([s(t),n])},d.addSingularRule=function(e,n){t.push([s(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.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 d.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 d.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 d.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(d.addUncountableRule),d}))),pt.exports),mt=ut(ft),gt=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;)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 s=(r+o)/2>>>0;n<e[s]?o=s:r=1+s}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||s,d=r.node||i,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 k=m-g,x=b-y,$=-1;if(k<x){if(-1<($=a(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+k,b,l(d,t,m,f,h)),n}else if(x<k&&-1<($=a(t,g,m,n,y,b,u)))return c(d,t,g,$),c(d,t,$+x,m),n;return k<2||x<2?(o(d,e,n,y,b,d(t[g],0)),c(d,t,g,m)):k==x&&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,y,b,l(d,t,m,f,h)):function(e,t,n,r,s,i,a,l,u,d,h,f,m){!function(e,t,n,r,s,i,a,l,u){for(var d=[],p=e.length,h=a,f=0;f<p;)switch(e[f++]){case 0:s++,h++;break;case 1:d.push(r[s]),o(t,n,r,s++,s,h<l?t(i[h],0):u);break;case-1:h++}for(f=0;f<p;)switch(e[f++]){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,h=n+s,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<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+h/2),g=m.length-1,b=f.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?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,i,a,l,d,f)||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 h=1;h<c;h++)d[h]=i;for(var f=o.slice(s,i),m=t;m<n;m++){var g,b=f.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 y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,k=w.oldi;v<n;)y[--c]=1,--n;for(;k<i;)y[--c]=-1,--i;y[--c]=0,--n,--i,w=w.prev}for(;t<=n;)y[--c]=1,--n;for(;s<=i;)y[--c]=-1,--i;return y}(n,r,s,i,a,l,u,d),e,t,n,r,a,l,h,m)}(d,e,n,y,b,x,t,g,m,k,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 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 w=y.Map;function v(){return this}function k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||x(this,n,t.call(this,e))},set:function(e){x(this,n,e)}}}var x=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,L,A={},T={},R=[],N=T.hasOwnProperty,O=0,P={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(O=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<O;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},I=Array.isArray||(E=($={}.toString).call([]),function(e){return $.call(e)===E}),j=(S=e,_="fragment",L="content"in z(C="template")?function(e){var t=z(C);return t.innerHTML=e,t.content}:function(e){var t,n=z(_),r=z(C);return D(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(_),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",D(t,n.firstChild.childNodes),t}:L)(e)});function D(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===_?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,H,B,F,U,W,G,V,Z=(q="appendChild",H="cloneNode",B="createTextNode",U=(F="importNode")in(M=e),(W=M.createDocumentFragment())[q](M[B]("g")),W[q](M[B]("")),(U?M[F](W,!0):W[H](!0)).childNodes.length<2?function e(t,n){for(var r=t[H](),o=t.childNodes||[],s=o.length,i=0;n&&i<s;i++)r[q](e(o[i],n));return r}:U?M[F]:function(e,t){return e[H](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},K="-"+Math.random().toFixed(6)+"%",Q=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+K+'"></p>',G.content.childNodes[0].getAttribute(V)==K)||(K="_dt: "+K.slice(1,-1)+";",Q=!0)}catch(u){}var X="\x3c!--"+K+"--\x3e",J=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,oe=" \\f\\n\\r\\t",se="[^"+oe+"\\/>\"'=]+",ie="["+oe+"]+"+se,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",le="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+se.replace("\\/","")+"))?)",ce=new RegExp(ae+ie+le+"+)(["+oe+"]*/?>)","g"),ue=new RegExp(ae+ie+le+"*)(["+oe+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,he)+r}function he(e,t,n){return t+(n||'"')+K+(n||'"')}function fe(e,t,n){return re.test(t)?e:"<"+t+n+"></"+t+">"}var me=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 ge(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a<i;){var l=s[a];switch(l.nodeType){case ee:var c=o.concat(a);!function(t,n,r,o){for(var s,i=t.attributes,a=[],l=[],c=me(i,r),u=c.length,d=0;d<u;){var p=c[d++],h=p.value===K;if(h||1<(s=p.value.split(X)).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=i[m]||i[m.toLowerCase()];if(h)n.push(be(g,o,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(be(g,o,m,s))}}l.push(p)}}for(var y=((d=0)<(u=l.length)&&Q&&!("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 k=e.createElement(v);for(u=i.length,d=0;d<u;)k.setAttributeNode(i[d++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(l,n,r,c),ge(l,n,r,c);break;case J:var u=l.textContent;if(u===K)r.shift(),n.push(ne.test(t.nodeName)?ye(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 te:ne.test(t.nodeName)&&Y.call(l.textContent)===X&&(r.shift(),n.push(ye(t,o)))}a++}}function be(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function ye(e,t){return{type:"text",node:e,path:t}}var we,ve=(we=new n,{get:function(e){return we.get(e)},set:function(e,t){return we.set(e,t),t}});function ke(e,t){var n=(e.convert||function(e){return e.join(X).replace(ue,fe).replace(ce,pe)})(t),r=e.transform;r&&(n=r(n));var o=j(n,e.type);$e(o);var s=[];return ge(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 xe=[];function $e(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 Ee,Se,_e=(Ee=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Se=/([^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),Le(n,!0)}(e,t):Le(e.style,!1)});function Ce(e,t,n){return t+"-"+n.toLowerCase()}function Le(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])||Ee.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(Se,Ce),":",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 Ae,Te,Re=(Ae=[].slice,(Te=Ne.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.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},Te.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},Ne);function Ne(e){var t=this.childNodes=Ae.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Oe(e){return{html:e}}function Pe(e,t){switch(e.nodeType){case Ue:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Fe:return Pe(e.render(),t);default:return e}}function Ie(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(Oe).then(t):Promise.resolve(P.invoke(e,t)).then(t)}function je(e){return null!=e&&"then"in e}var De,ze,Me,qe,He,Be="ownerSVGElement",Fe=v.prototype.nodeType,Ue=Re.prototype.nodeType,We=(ze=(De={Event:b,WeakSet:u}).Event,Me=De.WeakSet,qe=!0,He=null,function(e){return qe&&(qe=!qe,He=new Me,function(e){var t=new Me,n=new Me;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 ze(t),i=e.length,a=0;a<i;1===(o=e[a++]).nodeType&&function e(t,n,r,o,s){He.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)),He.add(e),e}),Ge=/^(?:form|list)$/i,Ve=[].slice;function Ze(t){return this.type=t,function(t){var n=xe,r=$e;return function(o){var s,i,a;return n!==o&&(s=t,i=n=o,a=ve.get(i)||ve.set(i,ke(s,i)),r=a.updates(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ye=!(Ze.prototype={attribute:function(e,t,n){var r,o=Be 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?We(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&&!Ge.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 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:Pe,before:e},o=Be 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=f(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=f(e.parentNode,t,[],r);break}default:if(s=!1,I(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":i({html:a});break;case"object":if(I(a[0])&&(a=a.concat.apply([],a)),je(a[0])){Promise.all(a).then(i);break}default:t=f(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=f(e.parentNode,t,11===a.nodeType?Ve.call(a.childNodes):[a],r):je(a)?a.then(i):"placeholder"in a?Ie(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=f(e.parentNode,t,Ve.call(j([].concat(a.html).join(""),o).childNodes),r):i("length"in a?Ve.call(a):P.invoke(a,i))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?je(r)?r.then(n):"placeholder"in r?Ie(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ve.call(r).join(""):P.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ke=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)},Ke=l?s:(i=new n,function(e){return i.get(e)||(n=s(t=e),i.set(t,n),n);var t,n})):Ye=!0,Qe(t)};function Qe(e){return Ye?e:Ke(e)}function Xe(e){for(var t=arguments.length,n=[Qe(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Je=new n,et=function(e){var t,n,r;return function(){var o=Xe.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ze(e),t=nt(n.apply(n,o))):n.apply(n,o),t}},tt=function(e,t){var n=t.indexOf(":"),r=Je.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Je.set(e,r={}),r[o]||(r[o]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Re(t):e},rt=new n;function ot(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ze(Be in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,it,at,lt,ct=P.define,ut=Ze.prototype;function dt(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?dt.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?dt.bind(e):tt(e,"html"):("raw"in e?et("html"):dt.wire).apply(null,arguments)}return dt.Component=v,dt.bind=function(e){return ot.bind(e)},dt.define=ct,dt.diff=f,(dt.hyper=dt).observe=We,dt.tagger=ut,dt.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},dt._={WeakMap:n,WeakSet:u},st=et,it=new n,at=Object.create,lt=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)||lt(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=at(null));return u[o]||(u[o]=new e(r))}}(this,it.get(e)||(r=e,o=new w,it.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:k("html",st),svg:k("svg",st),state:k("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}}}),dt}(document);const{Component:bt,bind:yt,define:wt,diff:vt,hyper:kt,wire:xt}=gt,$t=gt,Et=A,St=ct,_t=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)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(N.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",P(s,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){P(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&&P(s,r,o);if(""===t.trim()||!R.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!R.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?R.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Ct=mt,Lt=/['\u2019]s$/,At=/-/g,Tt=RegExp.escape??(e=>e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")),Rt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Nt="en"===r||r.startsWith("en-")?"en-AU":r,Ot=new Intl.DateTimeFormat(Nt,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Nt?"2-digit":"numeric"}),Pt=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function It(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 jt(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Dt(e,t="long"){const n=new Intl.ListFormat(r,{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 zt=Dt("conjunction"),Mt=Dt("disjunction");function qt(e,t){return zt(e,t).join("")}function Ht(e){return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function Bt(e){return e.trim().replace(/\s+/g," ")}function Ft(e,t=r){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const o=function(e,t,n=r){n=n.toLowerCase();const o=n.match(/^(\w{2,3})-.+$/)?.[1]??"";return e[n]?.[t]||e[o]?.[t]}(e,n,t)||e.en[n];if(!o)throw new Error(`No l10n data for key: "${n}"`);return o}})}function Ut(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){an(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}function Wt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>$t`${e}, `));return $t`${r}${n[n.length-1]}`}function Gt(e,t=!1){return(t?e:e.toLowerCase()).trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,"")}function Vt(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=Gt(n,r);if(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 Zt(e){const t=new Set,n="ltNodefault"in e.dataset?"":Bt(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>Bt(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r&&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(Bt(e))))}return[...t]}function Yt(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 Kt(e,t){const n=t.closest(Pt);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 Qt(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Xt(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 Jt 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)??e)}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function en(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Yt(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),tn(t),t}function tn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...nn(t)])e.remove()}function*nn(e){for(;e.nextNode();)yield e.currentNode}class rn 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 on extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});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||Vt(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,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function sn(e,t,n={}){const r={...n,isWarning:!1};fn("error",new on(e,t,r))}function an(e,t,n={}){const r={...n,isWarning:!0};fn("warn",new on(e,t,r))}function ln(e){return{amendConfiguration:e=>fn("amend-user-config",e),showError:(t,n)=>sn(t,e,n),showWarning:(t,n)=>an(t,e,n)}}function cn(e){return e?`\`${e}\``:""}function un(e,{quotes:t}={quotes:!1}){return Mt(e,t?e=>{return cn((t=e,String(t)?`"${t}"`:""));var t}:cn).join("")}function dn(e,...t){return pn(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(""))}function pn(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")}const hn=new EventTarget;function fn(e,t){if(hn.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function mn(e,t,n={once:!1}){hn.addEventListener(e,(async n=>{try{await t(n.detail)}catch(t){const n=t;sn(`Error in handler for topic "${e}": ${n.message}`,`sub:${e}`,{cause:n})}}),n)}const gn=["githubToken","githubUser"];const bn=new Map([["text/html","html"],["application/xml","xml"]]);function yn(e,t=document){const n=bn.get(e);if(!n){const t=[...bn.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=wn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function wn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;tn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar","toc-inline"),jt(r);const o=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&o.appendChild(s);const i=e.querySelector("meta[charset], meta[content*='charset=']")||$t`<meta charset="utf-8" />`;o.appendChild(i);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=$t`
1
+ window.respecVersion="37.5.0",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=document.documentElement;t?.hasAttribute("lang")||(t.lang="en",t.hasAttribute("dir")||(t.dir="ltr"));const n={},r=t?.lang??"en";var o=Object.freeze({__proto__:null,l10n:n,lang:r,name:"core/l10n",run:function(e){e.l10n=n[r]||n.en}});const i=(e,t)=>t.some(t=>e instanceof t);let s,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap;let d={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return m(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){d=e(d)}function h(e){return(a||(a=["advance","continue","continuePrimaryKey"].map(e=>IDBCursor.prototype[e]))).includes(e)?function(...t){return e.apply(g(this),t),m(this.request)}:function(...t){return m(e.apply(g(this),t))}}function f(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(l.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)});l.set(e,t)}(e),i(e,s||(s=[IDBIndex,IDBObjectStore,IDBCursor,IDBDatabase,IDBTransaction]))?new Proxy(e,d):e)}function m(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(m(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return u.set(t,e),t}(e);if(c.has(e))return c.get(e);const t=f(e);return Object.is(t,e)||(c.set(e,t),u.set(t,e)),t}const g=e=>u.get(e);const b=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],w={};function v(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(w[t])return w[t];const n=t.replace(/FromIndex$/,""),r=t!==n,o=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!b.includes(n))return;return w[t]=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]}}p(e=>({...e,get:(t,n,r)=>v(t,n)||e.get(t,n,r),has:(t,n)=>!!v(t,n)||e.has(t,n)}));const k=["advance","continue","continuePrimaryKey"],x={},$=new WeakMap,E=new WeakMap,S={get(e,t){if(!k.includes(t))return e[t];let n=x[t];return n||(n=x[t]=function(...e){$.set(this,E.get(this)[t](...e))}),n}};async function*_(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,S);for(E.set(n,t),u.set(n,g(t));t;)yield n,t=await($.get(n)||t.continue()),$.delete(n)}function C(e,t){return t===Symbol.asyncIterator&&i(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&i(e,[IDBIndex,IDBObjectStore])}p(e=>({...e,get:(t,n,r)=>C(t,n)?_:e.get(t,n,r),has:(t,n)=>C(t,n)||e.has(t,n)}));var A,L=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),m(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=m(s);return r&&s.addEventListener("upgradeneeded",e=>{r(m(s.result),e.oldVersion,e.newVersion,m(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:g,wrap:m});!function(e){e.ILLEGAL="ILLEGAL",e.EOF="EOF",e.NL="\n",e.SPACE=" ",e.UNDERSCORE="_",e.DOLLAR="$",e.ATSIGN="@",e.CARET="^",e.HASH="#",e.TILDE="~",e.AMPERSAND="&",e.IDENT="IDENT",e.COMMENT="COMMENT",e.STRING="STRING",e.NUMBER="NUMBER",e.FLOAT="FLOAT",e.CTLOP="CTLOP",e.BYTES="BYTES",e.HEX="HEX",e.BASE64="BASE64",e.ASSIGN="=",e.ARROWMAP="=>",e.TCHOICE="/",e.GCHOICE="//",e.TCHOICEALT="/=",e.GCHOICEALT="//=",e.PLUS="+",e.MINUS="-",e.QUEST="?",e.ASTERISK="*",e.INCLRANGE="..",e.EXCLRANGE="...",e.COMMA=",",e.DOT=".",e.COLON=":",e.SEMICOLON=";",e.LPAREN="(",e.RPAREN=")",e.LBRACE="{",e.RBRACE="}",e.LBRACK="[",e.RBRACK="]",e.LT="<",e.GT=">",e.QUOT='"'}(A||(A={}));const R=Object.entries(A).reduce((e,[t,n])=>(e[n]=t,e),{});new class{type;literal;comments;whitespace;constructor(e,t,n=[],r=""){this.type=e,this.literal=t,this.comments=n,this.whitespace=r}serialize(){let e="";for(const t of this.comments)e+=t.serialize();switch(e+=this.whitespace,this.type){case A.IDENT:case A.COMMENT:case A.NUMBER:case A.FLOAT:e+=this.literal;break;case A.STRING:e+='"'+this.literal+'"';break;case A.CTLOP:e+="."+this.literal;break;case A.BYTES:e+="'"+this.literal+"'";break;case A.HEX:e+="h'"+this.literal+"'";break;case A.BASE64:e+="b64'"+this.literal+"'";break;case A.EOF:break;default:e+=this.type.valueOf()}return e}startWithSpaces(){return""!==this.whitespace||this.comments.length>0}toString(e=0){const t=[`${" ".repeat(e)}${this.constructor.name}: ${R[this.type]} (${this.type})`];""!==this.whitespace&&t.push(" ".repeat(e+1)+`whitespaces: ${this.whitespace.length}`),""!==this.literal&&t.push(" ".repeat(e+1)+`literal: ${this.literal}`);for(const n of this.comments)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return{type:this.type,literal:this.literal,comments:this.comments?.map(e=>e.toJSON()),whitespace:this.whitespace}}}(A.ILLEGAL,"");const T=/^[!#$%&'*+-.^`|~\w]+$/,P=/[\u000A\u000D\u0009\u0020]/u,O=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function N(e,t,n){(t&&""!==t&&!e.has(t)&&O.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function I(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var j={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function D(e){j=e}var z={exec:()=>null};function M(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),o=t[r];return o||(o=e(r),t[r]=o),o}}function q(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(B.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var H=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),B={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:M(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`)),hrRegex:M(e=>new RegExp(`^ {0,${e}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\*[ \t]*){3,})(?:\\n+|$)`)),fencesBeginRegex:M(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:M(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:M(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:M(e=>new RegExp(`^ {0,${e}}(?:</?(?:${Q})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:M(e=>new RegExp(`^ {0,${e}}>`))},F=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,U=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,W=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,G=q(W).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),V=q(W).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Z=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Y=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,K=q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Y).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),X=q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,U).getRegex(),Q="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",J=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ee=q("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",J).replace("tag",Q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),te=e=>q(Z).replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Q).getRegex(),ne=te(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),re=te(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),oe={blockquote:q(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",re).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:K,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:F,html:ee,lheading:G,list:X,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:ne,table:z,text:/^[^\n]+/},ie=q("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Q).getRegex(),se={...oe,lheading:V,table:ie,paragraph:q(Z).replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ie).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Q).getRegex()},ae={...oe,html:q("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",J).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:z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q(Z).replace("hr",F).replace("heading"," *#{1,6} *[^\n]").replace("lheading",G).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},le=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ce=/[\p{P}\p{S}]/u,ue=/[\s\p{P}\p{S}]/u,de=/[^\s\p{P}\p{S}]/u,pe=q(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ue).getRegex(),he=/(?!~)[\p{P}\p{S}]/u,fe=q(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",H?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),me=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ge=q(me,"u").replace(/punct/g,ce).getRegex(),be=q(me,"u").replace(/punct/g,he).getRegex(),ye=q(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,"u").replace(/openQuote/g,/[\p{Pi}\p{Ps}"']/u).replace(/punct/g,ce).getRegex(),we="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ve=q(we,"gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),ke=q(we,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,he).getRegex(),xe=q("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),$e=q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),Ee=q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),Se=q(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ce).getRegex(),_e=q("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,ue).replace(/punct/g,ce).getRegex(),Ce=q(/\\(punct)/,"gu").replace(/punct/g,ce).getRegex(),Ae=q(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,ce).getRegex(),Le=q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),Re=q(J).replace("(?:--\x3e|$)","--\x3e").getRegex(),Te=q("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Re).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pe=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Oe=q(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Pe).getRegex(),Ne=q(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Oe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ie=q(/^!?\[(label)\]\[(ref)\]/).replace("label",Oe).replace("ref",Y).getRegex(),je=q(/^!?\[(ref)\](?:\[\])?/).replace("ref",Y).getRegex(),De=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,ze=q(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Pe).getRegex(),Me=q("reflink|nolink(?!\\()","g").replace("reflink",q(/^!?\[(label)\]\[(ref)\]/).replace("label",ze).replace("ref",De).getRegex()).replace("nolink",q(/^!?\[(ref)\](?:\[\])?/).replace("ref",De).getRegex()).getRegex(),qe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,He=q(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Be={_backpedal:z,anyPunctuation:Ce,anyPunctuationOutsideCode:Ae,autolink:Le,blockSkip:fe,br:le,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:z,delLDelim:z,delRDelim:z,emStrongLDelim:ge,emStrongRDelimAst:ve,emStrongRDelimUnd:$e,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Ne,nolink:je,punctuation:pe,reflink:Ie,reflinkSearch:Me,tag:Te,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:z},Fe={...Be,emStrongLDelim:ye,emStrongRDelimAst:xe,emStrongRDelimUnd:Ee,link:q(/^!?\[(label)\]\((.*?)\)/).replace("label",Oe).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Oe).getRegex()},Ue={...Be,emStrongRDelimAst:ke,emStrongLDelim:be,delLDelim:Se,delRDelim:_e,url:q(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",He).replace("protocol",qe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:q(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",qe).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},We={...Ue,br:q(le).replace("{2,}","*").getRegex(),text:q(Ue.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ge={normal:oe,gfm:se,pedantic:ae},Ve={normal:Be,gfm:Ue,breaks:We,pedantic:Fe},Ze={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ye=e=>Ze[e];function Ke(e,t){if(t){if(B.escapeTest.test(e))return e.replace(B.escapeReplace,Ye)}else if(B.escapeTestNoEncode.test(e))return e.replace(B.escapeReplaceNoEncode,Ye);return e}function Xe(e){try{e=encodeURI(e).replace(B.percentDecode,"%")}catch{return null}return e}function Qe(e,t){let n=e.replace(B.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(B.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(B.slashPipe,"|");return n}function Je(e,t,n){let r=e.length;if(0===r)return"";let o=0;for(;o<r;){if(e.charAt(r-o-1)!==t)break;o++}return e.slice(0,r-o)}function et(e){let t=e.split("\n"),n=t.length-1;for(;n>=0&&B.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join("\n")}function tt(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function nt(e,t){if(-1===e.indexOf(t[0])&&-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function rt(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function ot(e,t,n,r,o){let i=t.href,s=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1"),l="!"===e[0].charAt(0),c=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let p=r.inlineTokens(a),h=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=c,!l){if(h)return void(r.state.inRawBlock=d);r.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:i,title:s,text:a,tokens:p}}function it(e,t,n,r){if(!t.includes("<"))return!1;for(let o=0;o<t.length;o++){if("\\"===t[o]){o++;continue}if("`"===t[o]){let e=r.inline.code.exec(t.slice(o));if(e){o+=e[0].length-1;continue}}if("<"!==t[o])continue;let i=e.slice(n+o),s=r.inline.tag.exec(i)||r.inline.autolink.exec(i);if(s){if(s[0].length>t.length-o)return!0;o+=s[0].length-1}}return!1}var st=class{options;rules;lexer;constructor(e){this.options=e||j}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:et(t[0]),n=e.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let o=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return e.slice(Math.min(r.length,o.length))}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Je(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:"heading",raw:Je(t[0],"\n"),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Je(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Je(t[0],"\n").split("\n"),n="",r="",o=[];for(;e.length>0;){let t,i=!1,s=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))s.push(e[t]),i=!0;else{if(i)break;s.push(e[t])}e=e.slice(t);let a=s.join("\n"),l=a.replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>t+rt(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=c,0===e.length)break;let u=o.at(-1);if("code"===u?.type||"heading"===u?.type||"hr"===u?.type||"html"===u?.type)break;if("blockquote"===u?.type){let t=u,i=e.join("\n"),s=t.raw+"\n"+i.replace(this.rules.other.blockquoteSetextReplace2,""),a=this.blockquote(s);o[o.length-1]=a;let l=s.substring(a.raw.length).replace(/^\n/,""),c=l?l.split("\n").length:0,d=c?e.slice(0,-c):e;d.length>0&&(n=`${n}\n${d.join("\n")}`),r=r.substring(0,r.length-t.text.length)+a.text;break}if("list"===u?.type){let t=u,i=t.raw+"\n"+e.join("\n"),s=this.list(i);o[o.length-1]=s;let a=s.raw.length>t.raw.length?i.slice(t.raw.length+1,s.raw.length).split("\n").length:0;if(a>0){let t=e.slice(0,a).join("\n");n=`${n}\n${t}`,r=`${r}\n${t}`}e=e.slice(a);continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,o=t[1].trim(),i=o.length>1,s={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:!1,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=i?o:"[*+-]");let a=this.rules.other.listItemRegex(o),l=!1;for(;e;){let o=!1,i="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;let c=r();e=e.substring(t[0].length);let u=t[2].split("\n",1)[0],d=t[1].length,p=this.options.pedantic?rt(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>rt(e,d)),h=e.split("\n",1)[0],f=!p.trim(),m=0;if(this.options.pedantic?(m=2,i=p.trimStart()):f?m=d+1:(m=p.search(this.rules.other.nonSpaceChar),m=m>4?1:m,i=p.slice(m),m+=d),f&&this.rules.other.blankLine.test(h)&&(e=e.substring(h.length+1),o=!0),!o){let t=this.rules.other.nextBulletRegex(m),n=this.rules.other.hrRegex(m),r=this.rules.other.fencesBeginRegex(m),o=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(m):this.rules.other.headingBeginRegex(m),s=this.rules.other.htmlBeginRegex(m),a=this.rules.other.blockquoteBeginRegex(m);for(;e;){let l,c=e.split("\n",1)[0];if(h=c,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),l=h):l=h.replace(this.rules.other.leadingSpaceTab,e=>rt(e)),r.test(h)||o.test(h)||s.test(h)||a.test(h)||t.test(h)||n.test(h))break;if(l.search(this.rules.other.nonSpaceChar)>=m||!h.trim())i+="\n"+l.slice(m);else{if(f||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||r.test(p)||o.test(p)||n.test(p))break;i+="\n"+(!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(h)&&this.rules.block.lheading.test(`${p}\n${h}`)?` ${l.replace(/^ {0,3}/,"")}`:h)}f=!h.trim(),e=e.substring(c.length+1),p=l.slice(m)}}let g=n.slice(c,r());s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(l=!0)),s.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(i),loose:!1,text:i,tokens:[]})}let c=s.items.at(-1);if(!c)return;c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd(),s.raw=n.slice(0,r()).trimEnd();for(let e of s.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!s.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));s.loose=n}for(let e of s.items){let t=e.tokens[0];if(!e.task||"text"!==t?.type&&"paragraph"!==t?.type)e.task&&(e.task=!1);else{e.text=e.text.replace(this.rules.other.listReplaceTask,""),t.raw=t.raw.replace(this.rules.other.listReplaceTask,""),t.text=t.text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:"checkbox",raw:n[0]+" ",checked:"[ ]"!==n[0]};e.checked=t.checked,s.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:"paragraph",raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}}if(s.loose)for(let e of s.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=et(t[0]);return{type:"html",block:!0,raw:e,pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&-1!==nt(t[2],"()"))return;let e=tt(t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:Je(t[0],"\n"),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Qe(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],i={type:"table",raw:Je(t[0],"\n"),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?i.align.push("right"):this.rules.other.tableAlignCenter.test(e)?i.align.push("center"):this.rules.other.tableAlignLeft.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<n.length;e++)i.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:i.align[e]});for(let e of o)i.rows.push(Qe(e,i.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:Je(t[0],"\n"),depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let 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){let 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){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(!1===this.lexer.state.linkParenPossible)return;let t=this.rules.inline.link.exec(e);if(t){let n="!"===t[0].charAt(0)?2:1;if(!this.options.pedantic&&it(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Je(r.slice(0,-1),"\\");if((r.length-e.length)%2==0)return}else{let e=nt(t[2],"()");if(-2===e)return;if(e>-1){let 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 o=t[2],i="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(o);e&&(o=e[1],i=e[3])}else i=t[3]?t[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(o=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o.slice(1):o.slice(1,-1)),ot(t,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&it(e,n[1],r,this.rules))return;let o=t[tt((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "))];if(!o){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ot(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let o=r[0][0],i=n===o,s=t.length-e.length,a=s;for(;!this.options.pedantic&&a>0&&t[a-1]===o;)a--;let l=[...t.slice(Math.max(0,a-2),a)].at(-1)??"",c="*"===l||"_"===l||!!this.rules.inline.punctuation.exec(l);a<s&&(n=l);let u=a<s?c:!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||"";if(!d||!n||u){let n,u,p=[...r[0]].length-1,h=p,f=0,m=s-a+p,g=!(this.options.pedantic||!l.trim()||!d&&("*"!==o||c)),b="*"===o?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,t=t.slice(-1*e.length+p);null!==(r=b.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(u=[...n].length,r[3]||r[4]){h+=u;continue}if(r[5]||r[6]||g){if(i&&(r[5]||r[6]))break;if(m%3&&!((m+u)%3)){f+=u;continue}}if(h-=u,h>0)continue;u=Math.min(u,u+h+f);let t=[...r[0]][0].length,o=e.slice(0,p+r.index+t+u);if(Math.min(p,u)%2){let e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let s=o.slice(2,-2);return{type:"strong",raw:o,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,o,i=[...r[0]].length-1,s=i,a=this.rules.inline.delRDelim;for(a.lastIndex=0,t=t.slice(-1*e.length+i);null!==(r=a.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==i))continue;if(r[3]||r[4]){s+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s);let t=[...r[0]][0].length,a=e.slice(0,i+r.index+t+o),l=a.slice(i,-i);return{type:"del",raw:a,text:l,tokens:this.lexer.inlineTokens(l)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:e?t[0]:(n=t[0],B.numericCharacterReference.test(n)?n.replace(B.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(void 0===t&&void 0===n)return"&amp;";let r=void 0===t?Number.parseInt(n,16):Number.parseInt(t,10);return 0===r||r>1114111||r>=55296&&r<=57343?"�":38===r?"&amp;":String.fromCodePoint(r)}):n),escaped:e}}var n}},at=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||j,this.options.tokenizer=this.options.tokenizer||new st,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:B,block:Ge.normal,inline:Ve.normal};this.options.pedantic?(t.block=Ge.pedantic,t.inline=Ve.pedantic):this.options.gfm&&(t.block=Ge.gfm,this.options.breaks?t.inline=Ve.breaks:t.inline=Ve.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ge,inline:Ve}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(B.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(B.tabCharGlobal," ").replace(B.spaceLine,""));let r=1/0;for(;e;){if(!(e.length<r)){this.infiniteLoopError(e.charCodeAt(0));break}let o;if(r=e.length,this.options.extensions?.block?.some(n=>!!(o=n.call({lexer:this},e,t))&&(e=e.substring(o.raw.length),t.push(o),!0)))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let n=t.at(-1);1===o.raw.length&&void 0!==n?n.raw+="\n":t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+o.raw,n.text+="\n"+o.text,this.inlineQueue.at(-1).src=n.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+o.raw,n.text+="\n"+o.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title}),t.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(o=this.tokenizer.paragraph(i))){let r=t.at(-1);n&&"paragraph"===r?.type?(r.raw+=(r.raw.endsWith("\n")?"":"\n")+o.raw,r.text+="\n"+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(o),n=i.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+o.raw,n.text+="\n"+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&"!"!==e.charAt(n.index-1))return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf("[");if("!"!==e.charAt(0)&&Object.hasOwn(this.tokens.links,tt(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(")");try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes("*")||e.includes("_")||e.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==st.prototype.emStrong||this.tokenizer.del!==st.prototype.del?this.#t(e):e,r=!1,o="",i=1/0;for(;e;){if(!(e.length<i)){this.infiniteLoopError(e.charCodeAt(0));break}let s;if(i=e.length,r||(o=""),r=!1,this.options.extensions?.inline?.some(n=>!!(s=n.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0)))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let n=t.at(-1);"text"===s.type&&"text"===n?.type?(n.raw+=s.raw,n.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,n,o)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e,n,o)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),t.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}let a=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(a=e.substring(0,n+1))}if(s=this.tokenizer.inlineText(a)){e=e.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(o=s.raw.slice(-1)),r=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=s.raw,n.text+=s.text):t.push(s);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}#t(e){let t=e;if(this.tokens.links&&e.includes("[")){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,tt(t.slice(r+1,-1))))return t;if(r>1&&"!"!==t.charAt(0)){let o=t.slice(1,r-1);if(this.linkInText(o))return"["+o.replace(e,n)+"]["+"a".repeat(t.length-r-2)+"]"}return"["+"a".repeat(t.length-2)+"]"};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?"+".repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,"+")+t:e),t=t.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+"["+"a".repeat(e.length-r-2)+"]"}),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(!this.options.silent)throw new Error(t);console.error(t)}},lt=class{options;parser;constructor(e){this.options=e||j}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(B.notSpaceStart)?.[0],o=e?e.replace(B.endingNewline,"")+"\n":"";return r?'<pre><code class="language-'+Ke(r)+'">'+(n?o:Ke(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:Ke(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let o=e.rows[t];n="";for(let e=0;e<o.length;e++)n+=this.tablecell(o[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ke(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:o}){let i=o?Ke(n,!0):this.parser.parseInline(r),s=Xe(e);if(null===s)return i;let a='<a href="'+(e=Ke(s,o))+'"';return t&&(a+=' title="'+Ke(t)+'"'),a+=">"+i+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=Xe(e);if(null===o)return Ke(n);let i=`<img src="${Ke(e=o)}" alt="${Ke(n)}"`;return t&&(i+=` title="${Ke(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ke(e.text)}},ct=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return""}checkbox({raw:e}){return e}},ut=class e{options;renderer;textRenderer;constructor(e){this.options=e||j,this.options.renderer=this.options.renderer||new lt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ct,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(e.type)){t+=n||"";continue}}let o=r;switch(o.type){case"space":t+=this.renderer.space(o);break;case"hr":t+=this.renderer.hr(o);break;case"heading":t+=this.renderer.heading(o);break;case"code":t+=this.renderer.code(o);break;case"table":t+=this.renderer.table(o);break;case"blockquote":t+=this.renderer.blockquote(o);break;case"list":t+=this.renderer.list(o);break;case"checkbox":t+=this.renderer.checkbox(o);break;case"html":t+=this.renderer.html(o);break;case"def":t+=this.renderer.def(o);break;case"paragraph":t+=this.renderer.paragraph(o);break;case"text":t+=this.renderer.text(o);break;default:{let e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions?.renderers?.[o.type]){let e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}let i=o;switch(i.type){case"escape":case"text":n+=t.text(i);break;case"html":n+=t.html(i);break;case"link":n+=t.link(i);break;case"image":n+=t.image(i);break;case"checkbox":n+=t.checkbox(i);break;case"strong":n+=t.strong(i);break;case"em":n+=t.em(i);break;case"codespan":n+=t.codespan(i);break;case"br":n+=t.br(i);break;case"del":n+=t.del(i);break;default:{let e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},dt=class{options;block;constructor(e){this.options=e||j}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?at.lex:at.lexInline}provideParser(e=this.block){return e?ut.parse:ut.parseInline}};function pt(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var ht=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ut;Renderer=lt;TextRenderer=ct;Lexer=at;Tokenizer=st;Hooks=dt;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(pt(n,t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)pt(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)pt(n,this.walkTokens(e.tokens,t));break}case"list":{let e=r;pt(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let o=e[r].flat(1/0);pt(n,this.walkTokens(o,t))}):e.tokens&&pt(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let 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("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.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]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new lt(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,o=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new st(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,o=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new dt;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,o=e.hooks[r],i=t[r];dt.passThroughHooks.has(n)?t[r]=e=>{if(t.options.async&&dt.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await o.call(t,e);return i.call(t,n)})();let r=o.call(t,e);return i.call(t,r)}:t[r]=(...e)=>{if(t.options.async)return(async()=>{let n=await o.apply(t,e);return!1===n&&(n=await i.apply(t,e)),n})();let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&pt(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return at.lex(e,t??this.defaults)}parser(e,t){return ut.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(t):t,r=await(o.hooks?await o.hooks.provideLexer(e):e?at.lex:at.lexInline)(n,o),i=o.hooks?await o.hooks.processAllTokens(r):r;o.walkTokens&&await Promise.all(this.walkTokens(i,o.walkTokens));let s=await(o.hooks?await o.hooks.provideParser(e):e?ut.parse:ut.parseInline)(i,o);return o.hooks?await o.hooks.postprocess(s):s})().catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let n=(o.hooks?o.hooks.provideLexer(e):e?at.lex:at.lexInline)(t,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let r=(o.hooks?o.hooks.provideParser(e):e?ut.parse:ut.parseInline)(n,o);return o.hooks&&(r=o.hooks.postprocess(r)),r}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Ke(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ft(e,t){return ht.parse(e,t)}function mt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ft.options=ft.setOptions=function(e){return ht.setOptions(e),ft.defaults=ht.defaults,D(ft.defaults),ft},ft.getDefaults=I,ft.defaults=j,ft.use=function(...e){return ht.use(...e),ft.defaults=ht.defaults,D(ft.defaults),ft},ft.walkTokens=function(e,t){return ht.walkTokens(e,t)},ft.parseInline=ht.parseInline,ft.Parser=ut,ft.parser=ut.parse,ft.Renderer=lt,ft.TextRenderer=ct,ft.Lexer=at,ft.lexer=at.lex,ft.Tokenizer=st,ft.Hooks=dt,ft.parse=ft,ft.options,ft.setOptions,ft.walkTokens,ft.parseInline,ut.parse,at.lex;var gt,bt={exports:{}};var yt,wt=(gt||(gt=1,yt=bt,function(e,t){yt.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(t[0],function(n,r){var o,i,a=(o=t[1],i=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return i[t]||""}));return s(""===n?e[r-1]:n,a)})}function l(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 a(t,i)}return t}function c(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):l(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&l(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=c(o,r,e),d.isPlural=u(o,r,e),d.singular=c(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([i(t),n])},d.addSingularRule=function(e,n){t.push([i(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.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 d.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 d.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 d.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(d.addUncountableRule),d})),bt.exports),vt=mt(wt),kt=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 k=m-g,x=b-y,$=-1;if(k<x){if(-1<($=a(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+k,b,l(d,t,m,f,h)),n}else if(x<k&&-1<($=a(t,g,m,n,y,b,u)))return c(d,t,g,$),c(d,t,$+x,m),n;return k<2||x<2?(o(d,e,n,y,b,d(t[g],0)),c(d,t,g,m)):k==x&&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,k=w.oldi;v<n;)y[--c]=1,--n;for(;k<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,x,t,g,m,k,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 k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||x(this,n,t.call(this,e))},set:function(e){x(this,n,e)}}}var x=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={},R={},T=[],P=R.hasOwnProperty,O=0,N={attributes:L,define:function(e,t){e.indexOf("-")<0?(e in R||(O=T.push(e)),R[e]=t):L[e]=t},invoke:function(e,t){for(var n=0;n<O;n++){var r=T[n];if(P.call(e,r))return R[r](e[r],t)}}},I=Array.isArray||(E=($={}.toString).call([]),function(e){return $.call(e)===E}),j=(S=e,_="fragment",A="content"in z(C="template")?function(e){var t=z(C);return t.innerHTML=e,t.content}:function(e){var t,n=z(_),r=z(C);return D(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(_),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",D(t,n.firstChild.childNodes),t}:A)(e)});function D(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===_?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,H,B,F,U,W,G,V,Z=(q="appendChild",H="cloneNode",B="createTextNode",U=(F="importNode")in(M=e),(W=M.createDocumentFragment())[q](M[B]("g")),W[q](M[B]("")),(U?M[F](W,!0):W[H](!0)).childNodes.length<2?function e(t,n){for(var r=t[H](),o=t.childNodes||[],i=o.length,s=0;n&&s<i;s++)r[q](e(o[s],n));return r}:U?M[F]:function(e,t){return e[H](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},K="-"+Math.random().toFixed(6)+"%",X=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+K+'"></p>',G.content.childNodes[0].getAttribute(V)==K)||(K="_dt: "+K.slice(1,-1)+";",X=!0)}catch(u){}var Q="\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*)(['\"]?)"+Q+"\\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+"></"+t+">"}var pe=X?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===K;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)&&X&&!("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 k=e.createElement(v);for(u=s.length,d=0;d<u;)k.setAttributeNode(s[d++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(l,n,r,c),he(l,n,r,c);break;case 8:var u=l.textContent;if(u===K)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 ke,xe,$e=(ke=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,xe=/([^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 Ee(e,t,n){return t+"-"+n.toLowerCase()}function Se(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])||ke.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(xe,Ee),":",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 _e,Ce,Ae=(_e=[].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=_e.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Re(e){return{html:e}}function Te(e,t){switch(e.nodeType){case He:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return Te(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(Re).then(t):Promise.resolve(N.invoke(e,t)).then(t)}function Oe(e){return null!=e&&"then"in e}var Ne,Ie,je,De,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,He=Ae.prototype.nodeType,Be=(Ie=(Ne={Event:b,WeakSet:u}).Event,je=Ne.WeakSet,De=!0,ze=null,function(e){return De&&(De=!De,ze=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 Ie(t),s=e.length,a=0;a<s;1===(o=e[a++]).nodeType&&function e(t,n,r,o,i){ze.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)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Ue=[].slice;function We(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(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(We.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&&!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 N.attributes)return function(n){var o=N.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:Te,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,I(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(I(a[0])&&(a=a.concat.apply([],a)),Oe(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?Ue.call(a.childNodes):[a],r):Oe(a)?a.then(s):"placeholder"in a?Pe(a,s):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=f(e.parentNode,t,Ue.call(j([].concat(a.html).join(""),o).childNodes),r):s("length"in a?Ue.call(a):N.invoke(a,s))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?Oe(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?Ue.call(r).join(""):N.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=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)},Ve=l?i:(s=new n,function(e){return s.get(e)||(n=i(t=e),s.set(t,n),n);var t,n})):Ge=!0,Ze(t)};function Ze(e){return Ge?e:Ve(e)}function Ye(e){for(var t=arguments.length,n=[Ze(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ke=new n,Xe=function(e){var t,n,r;return function(){var o=Ye.apply(null,arguments);return r!==o[0]?(r=o[0],n=new We(e),t=Je(n.apply(n,o))):n.apply(n,o),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Ke.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ke.set(e,r={}),r[o]||(r[o]=Xe(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 We(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=N.define,at=We.prototype;function lt(e){return arguments.length<2?null==e?Xe("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Xe("html")(e):"nodeType"in e?lt.bind(e):Qe(e,"html"):("raw"in e?Xe("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?Xe(t||"html"):Qe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Xe,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:k("html",nt),svg:k("svg",nt),state:k("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{Component:xt,bind:$t,define:Et,diff:St,hyper:_t,wire:Ct}=kt,At=kt,Lt=L,Rt=ft,Tt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)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(P.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",N(i,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){N(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&&N(i,r,o);if(""===t.trim()||!T.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!T.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?T.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Pt=vt,Ot=/['\u2019]s$/,Nt=/-/g,It=RegExp.escape??(e=>e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")),jt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Dt="en"===r||r.startsWith("en-")?"en-AU":r,zt=new Intl.DateTimeFormat(Dt,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Dt?"2-digit":"numeric"});function Mt(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 qt(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach(e=>{e.remove()})}function Ht(e,t="long"){const n=new Intl.ListFormat(r,{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 Bt=Ht("conjunction"),Ft=Ht("disjunction");function Ut(e,t){return Bt(e,t).join("")}function Wt(e){return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function Gt(e){return e.trim().replace(/\s+/g," ")}function Vt(e,t=r){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const o=function(e,t,n=r){n=n.toLowerCase();const o=n.match(/^(\w{2,3})-.+$/)?.[1]??"";return e[n]?.[t]||e[o]?.[t]}(e,n,t)||e.en[n];if(!o)throw new Error(`No l10n data for key: "${n}"`);return o}})}function Zt(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){dn(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}function Yt(e,t=e=>e){const n=e.map(t),r=n.slice(0,-1).map(e=>At`${e}, `);return At`${r}${n[n.length-1]}`}function Kt(e,t=!1){return(t?e:e.toLowerCase()).trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,"")}function Xt(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=Kt(n,r);if(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 Qt(e){const t=new Set,n="ltNodefault"in e.dataset?"":Gt(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>Gt(e)).forEach(e=>t.add(e)):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r&&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(Gt(e)))}return[...t]}function Jt(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 en(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 tn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function nn(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 rn 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)??e)}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find(t=>t.toLowerCase()===e.toLowerCase())}}function on(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{Jt(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),sn(t),t}function sn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...an(t)])e.remove()}function*an(e){for(;e.nextNode();)yield e.currentNode}class ln 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,{...n.cause&&{cause:n.cause}});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||Xt(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,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function un(e,t,n={}){const r={...n,isWarning:!1};yn("error",new cn(e,t,r))}function dn(e,t,n={}){const r={...n,isWarning:!0};yn("warn",new cn(e,t,r))}function pn(e){return{amendConfiguration:e=>yn("amend-user-config",e),showError:(t,n)=>un(t,e,n),showWarning:(t,n)=>dn(t,e,n)}}function hn(e){return e?`\`${e}\``:""}function fn(e,{quotes:t}={quotes:!1}){return Ft(e,t?e=>{return hn((t=e,String(t)?`"${t}"`:""));var t}:hn).join("")}function mn(e,...t){return gn(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(""))}function gn(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")}const bn=new EventTarget;function yn(e,t){if(bn.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function wn(e,t,n={once:!1}){bn.addEventListener(e,async n=>{try{await t(n.detail)}catch(t){const n=t;un(`Error in handler for topic "${e}": ${n.message}`,`sub:${e}`,{cause:n})}},n)}const vn=["githubToken","githubUser"];const kn=new Map([["text/html","html"],["application/xml","xml"]]);function xn(e,t=document){const n=kn.get(e);if(!n){const t=[...kn.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=$n(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function $n(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;sn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar","toc-inline"),qt(r);const o=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&o.appendChild(i);const s=e.querySelector("meta[charset], meta[content*='charset=']")||At`<meta charset="utf-8" />`;o.appendChild(s);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=At`
2
2
  <meta name="generator" content="${a}" />
3
- `;o.appendChild(l),t.prepend(o),fn("beforesave",r)}(n);let r="";if("xml"===e)r=(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&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}async function vn(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href));return await n.text()}const kn=(e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).endsWith("/src/core/worker.js")?new URL("../../builds/respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).href:new URL("respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).href,xn=It({hint:"preload",href:kn,as:"script"});async function $n(){try{return(await Promise.resolve().then((function(){return dr}))).default}catch{return vn("worker/respec-worker.js")}}async function En(){try{const e=await fetch(kn);if(e.ok)return await e.text()}catch{}return null}document.head.appendChild(xn);const Sn=async function(){const[e,t]=await Promise.all([$n(),En()]),n=new Blob([null!==t?`${t}\n`:'self.RESPEC_HIGHLIGHT_URL = "https://www.w3.org/Tools/respec/respec-highlight";\n',e],{type:"application/javascript"});return new Worker(URL.createObjectURL(n))}();class _n{constructor(){this._respecDonePromise=new Promise((e=>{mn("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],mn("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),mn("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}get worker(){return Sn}async toHTML(){return wn("html",document)}}const Cn="core/post-process",Ln=15e3;function An(e,t){return new Promise(((n,r)=>{const o=setTimeout((()=>{r(new Error(`${t} timed out.`))}),Ln);Promise.resolve(e).then(n,r).finally((()=>{clearTimeout(o)}))}))}const Tn="core/pre-process",Rn=15e3;const Nn="core/base-runner";async function On(e){!function(){const e=new _n;Object.defineProperty(document,"respec",{value:e})}(),fn("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),mn("amend-user-config",n),mn("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of gn)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]})),r=Object.fromEntries(n);Object.assign(e,r),fn("amend-user-config",r)}(respecConfig),performance.mark(`${Nn}-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.",Tn),t}));for(const[n,r]of t.entries()){const t=`${Tn}/${r.name||`[${n}]`}`,o=ln(t);try{await new Promise(((n,s)=>{const i=setTimeout((()=>{s(new Error(`preProcess function "${t}" timed out.`))}),Rn);Promise.resolve().then((()=>r(e,document,o))).then(n,s).finally((()=>{clearTimeout(i)}))}))}catch(e){sn(`Function ${t} threw an error during \`preProcess\`.`,Tn,{hint:"See developer console.",cause:e})}}}}(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))),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(void 0)):n.run&&(await n.run(t),r(void 0))}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),fn("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.",Cn),t}));for(const[n,r]of t.entries()){const t=`${Cn}/${r.name||`[${n}]`}`,o=ln(t);try{await An(r(e,document,o),`postProcess function "${t}"`)}catch(e){sn(`Function ${t} threw an error during \`postProcess\`.`,Cn,{hint:"See developer console.",cause:e})}}}if("function"==typeof e.afterEnd)try{await An(e.afterEnd(e,document),"config.afterEnd")}catch(e){sn("Function afterEnd threw an error.",Cn,{hint:"See developer console.",cause:e})}}(respecConfig),fn("end-all",void 0),jt(document),performance.mark(`${Nn}-end`),performance.measure(Nn,`${Nn}-start`,`${Nn}-end`)}var Pn=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}
3
+ `;o.appendChild(l),t.prepend(o),yn("beforesave",r)}(n);let r="";if("xml"===e)r=(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&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}async function En(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href));return await n.text()}const Sn=(e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).endsWith("/src/core/worker.js")?new URL("../../builds/respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).href:new URL("respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).href,_n=Mt({hint:"preload",href:Sn,as:"script"});async function Cn(){try{return(await Promise.resolve().then(function(){return hr})).default}catch{return En("worker/respec-worker.js")}}async function An(){try{const e=await fetch(Sn);if(e.ok)return await e.text()}catch{}return null}document.head.appendChild(_n);const Ln=async function(){const[e,t]=await Promise.all([Cn(),An()]),n=new Blob([null!==t?`${t}\n`:'self.RESPEC_HIGHLIGHT_URL = "https://www.w3.org/Tools/respec/respec-highlight";\n',e],{type:"application/javascript"});return new Worker(URL.createObjectURL(n))}();class Rn{constructor(){this._respecDonePromise=new Promise(e=>{wn("end-all",()=>e(),{once:!0})}),this.errors=[],this.warnings=[],wn("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),wn("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}get worker(){return Ln}async toHTML(){return $n("html",document)}}const Tn="core/post-process";function Pn(e,t){return new Promise((n,r)=>{const o=setTimeout(()=>{r(new Error(`${t} timed out.`))},15e3);Promise.resolve(e).then(n,r).finally(()=>{clearTimeout(o)})})}const On="core/pre-process";const Nn="core/base-runner";async function In(e){!function(){const e=new Rn;Object.defineProperty(document,"respec",{value:e})}(),yn("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),wn("amend-user-config",n),wn("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of vn)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]}),r=Object.fromEntries(n);Object.assign(e,r),yn("amend-user-config",r)}(respecConfig),performance.mark(`${Nn}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||un("Every item in `preProcess` must be a JS function.",On),t});for(const[n,r]of t.entries()){const t=`${On}/${r.name||`[${n}]`}`,o=pn(t);try{await new Promise((n,i)=>{const s=setTimeout(()=>{i(new Error(`preProcess function "${t}" timed out.`))},15e3);Promise.resolve().then(()=>r(e,document,o)).then(n,i).finally(()=>{clearTimeout(s)})})}catch(e){un(`Function ${t} threw an error during \`preProcess\`.`,On,{hint:"See developer console.",cause:e})}}}}(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)),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(void 0)):n.run&&(await n.run(t),r(void 0))}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),yn("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||un("Every item in `postProcess` must be a JS function.",Tn),t});for(const[n,r]of t.entries()){const t=`${Tn}/${r.name||`[${n}]`}`,o=pn(t);try{await Pn(r(e,document,o),`postProcess function "${t}"`)}catch(e){un(`Function ${t} threw an error during \`postProcess\`.`,Tn,{hint:"See developer console.",cause:e})}}}if("function"==typeof e.afterEnd)try{await Pn(e.afterEnd(e,document),"config.afterEnd")}catch(e){un("Function afterEnd threw an error.",Tn,{hint:"See developer console.",cause:e})}}(respecConfig),yn("end-all",void 0),qt(document),performance.mark(`${Nn}-end`),performance.measure(Nn,`${Nn}-start`,`${Nn}-end`)}var jn=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}
4
4
  #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000}
5
5
  #respec-pill,.respec-info-button{height:2.4em;background:#fff;background:var(--bg,#fff);color:#787878;color:var(--tocnav-normal-text,#787878);border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);box-shadow:1px 1px 8px 0 var(--tocsidebar-shadow,rgba(100,100,100,.5));padding:.2em 0}
6
6
  .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity}
@@ -64,37 +64,37 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r
64
64
  .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center}
65
65
  .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px}
66
66
  p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
67
- .respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const In=new Set;function jn(e,{id:t,className:n,before:r}={}){const o=document.createElement("style");return t&&(o.id=t),void 0!==n&&(o.className=n),o.textContent=e,document.head.insertBefore(o,r??null),In.add(o),o}const Dn=/&gt;/gm,zn=/&amp;/gm;class Mn extends St.Renderer{code(e){const{text:t,lang:n=""}=e,{language:r,...o}=Mn.parseInfoString(n);if(/(^webidl$)/i.test(r))return`<pre class="idl">${t}</pre>`;const s=super.code({...e,lang:r}).replace('class="language-','class="'),{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){const{href:t,title:n,text:r}=e;if(!n)return super.image(e);return String.raw`
67
+ .respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Dn=new Set;function zn(e,{id:t,className:n,before:r}={}){const o=document.createElement("style");return t&&(o.id=t),void 0!==n&&(o.className=n),o.textContent=e,document.head.insertBefore(o,r??null),Dn.add(o),o}const Mn=/&gt;/gm,qn=/&amp;/gm;class Hn extends Rt.Renderer{code(e){const{text:t,lang:n=""}=e,{language:r,...o}=Hn.parseInfoString(n);if(/(^webidl$)/i.test(r))return`<pre class="idl">${t}</pre>`;const i=super.code({...e,lang:r}).replace('class="language-','class="'),{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){const{href:t,title:n,text:r}=e;if(!n)return super.image(e);return String.raw`
68
68
  <figure>
69
69
  <img src="${t}" alt="${r}" />
70
70
  <figcaption>${n}</figcaption>
71
71
  </figure>
72
- `}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){const t=this.parser.parseInline(e.tokens),n=e.depth,r=t.match(/(.+)\s+{#([\w-]+)}$/);if(r){const[,e,t]=r;return`<h${n} id="${t}">${e}</h${n}>`}return super.heading(e)}}const qn={gfm:!0,renderer:new Mn};function Hn(e,t={inline:!1}){const n=function(e){if(!e)return e;const t=e.trimEnd().split("\n"),n=t.findIndex((e=>e.trim()));if(-1===n)return"";const r=t.slice(n),o=r[0].search(/[^\s]/);if(o<1)return r.join("\n");const s=" ".repeat(o);return r.map((e=>e.startsWith(s)?e.slice(o):e)).join("\n")}(e),r=n.replace(Dn,">").replace(zn,"&");return t.inline?St.parseInline(r,qn):St.parse(r,qn)}function Bn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Hn(e.innerHTML)}const Fn=(Un="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Un);return t.forEach(Bn),Array.from(t)});var Un;var Wn=Object.freeze({__proto__:null,markdownToHtml:Hn,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 Fn(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=Xt(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Bn(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),r&&o.append(r),document.body.replaceWith(o)}});function Gn(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}jn(Pn,{id:"respec-ui-styles",className:"removeOnSave"});const Vn=$t`<div id="respec-ui" class="removeOnSave" hidden></div>`,Zn=$t`<ul
72
+ `}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){const t=this.parser.parseInline(e.tokens),n=e.depth,r=t.match(/(.+)\s+{#([\w-]+)}$/);if(r){const[,e,t]=r;return`<h${n} id="${t}">${e}</h${n}>`}return super.heading(e)}}const Bn={gfm:!0,renderer:new Hn};function Fn(e,t={inline:!1}){const n=function(e){if(!e)return e;const t=e.trimEnd().split("\n"),n=t.findIndex(e=>e.trim());if(-1===n)return"";const r=t.slice(n),o=r[0].search(/[^\s]/);if(o<1)return r.join("\n");const i=" ".repeat(o);return r.map(e=>e.startsWith(i)?e.slice(o):e).join("\n")}(e),r=n.replace(Mn,">").replace(qn,"&");return t.inline?Rt.parseInline(r,Bn):Rt.parse(r,Bn)}function Un(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Fn(e.innerHTML)}const Wn=(Gn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Gn);return t.forEach(Un),Array.from(t)});var Gn;var Vn=Object.freeze({__proto__:null,markdownToHtml:Fn,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 Wn(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=nn(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Un(o),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(o.querySelectorAll(".nolinks a[href]")),r&&o.append(r),document.body.replaceWith(o)}});function Zn(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute(`aria-${t}`,n)})}zn(jn,{id:"respec-ui-styles",className:"removeOnSave"});const Yn=At`<div id="respec-ui" class="removeOnSave" hidden></div>`,Kn=At`<ul
73
73
  id="respec-menu"
74
74
  role="menu"
75
75
  aria-labelledby="respec-pill"
76
76
  hidden
77
- ></ul>`,Yn=$t`<button
77
+ ></ul>`,Xn=At`<button
78
78
  class="close-button"
79
- onclick=${()=>ir.closeModal()}
79
+ onclick=${()=>lr.closeModal()}
80
80
  aria-label="Close"
81
81
  >
82
82
  ❌
83
- </button>`;let Kn,Qn;window.addEventListener("load",(()=>rr(Zn)));const Xn=[],Jn=[],er={};mn("start-all",(()=>document.body.prepend(Vn)),{once:!0}),mn("end-all",(()=>document.body.prepend(Vn)),{once:!0});const tr=$t`<button id="respec-pill" disabled>ReSpec</button>`;function nr(){Zn.classList.toggle("respec-hidden"),Zn.classList.toggle("respec-visible"),Zn.hidden=!Zn.hidden}function rr(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=>{const t=e;"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(r.focus(),t.preventDefault()):document.activeElement===r&&(n.focus(),t.preventDefault()))}))}Vn.appendChild(tr),tr.addEventListener("click",(e=>{e.stopPropagation(),tr.setAttribute("aria-expanded",String(Zn.hidden)),nr(),Zn.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{Zn.hidden||nr()})),Vn.appendChild(Zn),Zn.addEventListener("keydown",(e=>{"Escape"!==e.key||Zn.hidden||(tr.setAttribute("aria-expanded",String(Zn.hidden)),nr(),tr.focus())}));const or=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function sr(e,t,n,r){t.push(e),er.hasOwnProperty(n)||(er[n]=function(e,t,n){const r=`respec-pill-${e}`,o=$t`<button
83
+ </button>`;let Qn,Jn;window.addEventListener("load",()=>ir(Kn));const er=[],tr=[],nr={};wn("start-all",()=>document.body.prepend(Yn),{once:!0}),wn("end-all",()=>document.body.prepend(Yn),{once:!0});const rr=At`<button id="respec-pill" disabled>ReSpec</button>`;function or(){Kn.classList.toggle("respec-hidden"),Kn.classList.toggle("respec-visible"),Kn.hidden=!Kn.hidden}function ir(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=>{const t=e;"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(r.focus(),t.preventDefault()):document.activeElement===r&&(n.focus(),t.preventDefault()))})}Yn.appendChild(rr),rr.addEventListener("click",e=>{e.stopPropagation(),rr.setAttribute("aria-expanded",String(Kn.hidden)),or(),Kn.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{Kn.hidden||or()}),Yn.appendChild(Kn),Kn.addEventListener("keydown",e=>{"Escape"!==e.key||Kn.hidden||(rr.setAttribute("aria-expanded",String(Kn.hidden)),or(),rr.focus())});const sr=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function ar(e,t,n,r){t.push(e),nr.hasOwnProperty(n)||(nr[n]=function(e,t,n){const r=`respec-pill-${e}`,o=At`<button
84
84
  id="${r}"
85
85
  class="respec-info-button"
86
- ></button>`;o.addEventListener("click",(()=>{o.setAttribute("aria-expanded","true");const r=$t`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(ar(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}ir.freshModal(n,r,o)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Gn(o,s),o}(n,t,r),Vn.appendChild(er[n]));const o=er[n];o.textContent=String(t.length);const s=1===t.length?Ct.singular(r):r;Gn(o,new Map([["label",`${t.length} ${s}`]]))}Gn(tr,or);const ir={show(){try{Vn.hidden=!1}catch(e){console.error(e)}},hide(){Vn.hidden=!0},enable(){tr.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=$t`<button id="${o}" class="respec-option">
86
+ ></button>`;o.addEventListener("click",()=>{o.setAttribute("aria-expanded","true");const r=At`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(cr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}lr.freshModal(n,r,o)});const i=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Zn(o,i),o}(n,t,r),Yn.appendChild(nr[n]));const o=nr[n];o.textContent=String(t.length);const i=1===t.length?Pt.singular(r):r;Zn(o,new Map([["label",`${t.length} ${i}`]]))}Zn(rr,sr);const lr={show(){try{Yn.hidden=!1}catch(e){console.error(e)}},hide(){Yn.hidden=!0},enable(){rr.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=At`<button id="${o}" class="respec-option">
87
87
  <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}…
88
- </button>`,i=$t`<li role="menuitem">${s}</li>`;return i.addEventListener("click",t),Zn.appendChild(i),s},error(e){sr(e,Xn,"error","ReSpec Errors")},warning(e){sr(e,Jn,"warning","ReSpec Warnings")},closeModal(e){if(Qn){const e=Qn;e.classList.remove("respec-show-overlay"),e.classList.add("respec-hide-overlay"),e.addEventListener("transitionend",(()=>{e.remove(),Qn=null}))}e&&e.setAttribute("aria-expanded","false"),Kn&&(Kn.remove(),Kn=null,tr.focus())},freshModal(e,t,n){Kn&&Kn.remove(),Qn&&Qn.remove(),Qn=$t`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;Kn=$t`<div
88
+ </button>`,s=At`<li role="menuitem">${i}</li>`;return s.addEventListener("click",t),Kn.appendChild(s),i},error(e){ar(e,er,"error","ReSpec Errors")},warning(e){ar(e,tr,"warning","ReSpec Warnings")},closeModal(e){if(Jn){const e=Jn;e.classList.remove("respec-show-overlay"),e.classList.add("respec-hide-overlay"),e.addEventListener("transitionend",()=>{e.remove(),Jn=null})}e&&e.setAttribute("aria-expanded","false"),Qn&&(Qn.remove(),Qn=null,rr.focus())},freshModal(e,t,n){Qn&&Qn.remove(),Jn&&Jn.remove(),Jn=At`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;Qn=At`<div
89
89
  id="${r}"
90
90
  class="respec-modal removeOnSave"
91
91
  role="dialog"
92
92
  aria-labelledby="${o}"
93
93
  >
94
- ${Yn}
94
+ ${Xn}
95
95
  <h3 id="${o}">${e}</h3>
96
96
  <div class="inside">${t}</div>
97
- </div>`;const s=new Map([["labelledby",o]]);Gn(Kn,s),document.body.append(Qn,Kn),Qn.addEventListener("click",(()=>this.closeModal(n))),Qn.classList.toggle("respec-show-overlay"),Kn.hidden=!1,rr(Kn)}};function ar(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Hn(`<p class="respec-hint"><strong>How to fix:</strong> ${pn(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 ${Hn(e.elements.map(lr).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${Hn(`**${Ht(e.message)}**`,{inline:!0})}${n}${r}${o}${t}`}function lr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function cr(e){try{ir.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await On(e)}finally{ir.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&ir.closeModal()})),window.respecUI=ir,mn("error",(e=>ir.error(e))),mn("warn",(e=>ir.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const ur=[Promise.resolve().then((function(){return pr})),Promise.resolve().then((function(){return o})),Promise.resolve().then((function(){return br})),Promise.resolve().then((function(){return kr})),Promise.resolve().then((function(){return Er})),Promise.resolve().then((function(){return Nr})),Promise.resolve().then((function(){return Wn})),Promise.resolve().then((function(){return Or})),Promise.resolve().then((function(){return jr})),Promise.resolve().then((function(){return Qr})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return oo})),Promise.resolve().then((function(){return io})),Promise.resolve().then((function(){return vs})),Promise.resolve().then((function(){return Es})),Promise.resolve().then((function(){return Ps})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Ms})),Promise.resolve().then((function(){return Us})),Promise.resolve().then((function(){return Ys})),Promise.resolve().then((function(){return Xs})),Promise.resolve().then((function(){return zo})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return li})),Promise.resolve().then((function(){return Ci})),Promise.resolve().then((function(){return Zo})),Promise.resolve().then((function(){return Ai})),Promise.resolve().then((function(){return Lr})),Promise.resolve().then((function(){return Ti})),Promise.resolve().then((function(){return zi})),Promise.resolve().then((function(){return qi})),Promise.resolve().then((function(){return Bi})),Promise.resolve().then((function(){return Vi})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return ea})),Promise.resolve().then((function(){return sa})),Promise.resolve().then((function(){return ua})),Promise.resolve().then((function(){return pa})),Promise.resolve().then((function(){return fa})),Promise.resolve().then((function(){return xa})),Promise.resolve().then((function(){return Sa})),Promise.resolve().then((function(){return Ra})),Promise.resolve().then((function(){return Na})),Promise.resolve().then((function(){return Ia})),Promise.resolve().then((function(){return qa})),Promise.resolve().then((function(){return Wa})),Promise.resolve().then((function(){return Ya})),Promise.resolve().then((function(){return Xa})),Promise.resolve().then((function(){return tl})),Promise.resolve().then((function(){return ol})),Promise.resolve().then((function(){return al}))];Promise.all(ur).then((e=>cr(e))).catch((e=>console.error(e)));var dr=Object.freeze({__proto__:null,default:'// ReSpec Worker\n"use strict";\n// hljs is either inlined by core/worker.js (preferred) or loaded below via\n// importScripts as a fallback when the inline fetch was not possible.\nif (typeof self.hljs === "undefined" && self.RESPEC_HIGHLIGHT_URL) {\n try {\n importScripts(self.RESPEC_HIGHLIGHT_URL);\n } catch (err) {\n console.error("Network error loading highlighter", err);\n }\n}\n\nself.addEventListener("message", ({ data }) => {\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, langScript, propName, lang } = data;\n console.warn(\n `[ReSpec] The "highlight-load-lang" worker action is deprecated ` +\n `and will be removed in a future version. ` +\n `To migrate, fetch your language script in the main thread and ` +\n `send the text as "langScript" instead of "langURL". ` +\n `The "langURL" path may fail in Firefox. ` +\n `See https://github.com/speced/respec/issues/5228`\n );\n try {\n if (langScript) {\n const blob = new Blob([langScript], {\n type: "application/javascript",\n });\n const objectURL = URL.createObjectURL(blob);\n try {\n importScripts(objectURL);\n } finally {\n URL.revokeObjectURL(objectURL);\n }\n } else if (langURL) {\n const { protocol, hostname } = new URL(langURL);\n const isSecure =\n protocol === "https:" ||\n (protocol === "http:" &&\n (hostname === "localhost" ||\n hostname === "127.0.0.1" ||\n hostname === "[::1]"));\n if (!isSecure) {\n throw new Error(\n `langURL must be https: or http: on localhost, got "${langURL}"`\n );\n }\n importScripts(langURL);\n } else {\n throw new Error(\n `No langScript or langURL provided for language "${lang}"`\n );\n }\n if (typeof self[propName] === "function") {\n self.hljs.registerLanguage(lang, self[propName]);\n } else {\n throw new Error(\n `Language definer "${propName}" is not a function on self`\n );\n }\n } catch (err) {\n console.error("Failed to load or register language", lang, err);\n }\n delete data.langScript;\n delete data.langURL;\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 Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'});var pr=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(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)}window.location.hash=`#${e}`}))}});const hr="core/defaults",fr={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,"no-dfn-in-abstract":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0};const mr=new Map([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),gr={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 br=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...fr.lint,...gr.lint,...e.lint};Object.assign(e,{...fr,...gr,...e,lint:t}),function(e){if(!e.hasOwnProperty("noToc"))return;e.noTOC??=e.noToc;const t=dn`Please use ${"[noTOC]"} instead.`;an("The `noToc` configuration option is deprecated.",hr,{hint:t})}(e),Object.assign(e,function(e){return{licenseInfo:mr.get(e.license)}}(e))}});const yr=String.raw,wr=String.raw`color-mix(in srgb, #eaf3ff 15%, transparent)`;const vr=jn(yr`@keyframes pop{
97
+ </div>`;const i=new Map([["labelledby",o]]);Zn(Qn,i),document.body.append(Jn,Qn),Jn.addEventListener("click",()=>this.closeModal(n)),Jn.classList.toggle("respec-show-overlay"),Qn.hidden=!1,ir(Qn)}};function cr(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Fn(`<p class="respec-hint"><strong>How to fix:</strong> ${gn(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 ${Fn(e.elements.map(ur).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${Fn(`**${Wt(e.message)}**`,{inline:!0})}${n}${r}${o}${t}`}function ur(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function dr(e){try{lr.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await In(e)}finally{lr.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&lr.closeModal()}),window.respecUI=lr,wn("error",e=>lr.error(e)),wn("warn",e=>lr.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const pr=[Promise.resolve().then(function(){return fr}),Promise.resolve().then(function(){return o}),Promise.resolve().then(function(){return yr}),Promise.resolve().then(function(){return xr}),Promise.resolve().then(function(){return Sr}),Promise.resolve().then(function(){return Or}),Promise.resolve().then(function(){return Vn}),Promise.resolve().then(function(){return Nr}),Promise.resolve().then(function(){return Dr}),Promise.resolve().then(function(){return Xr}),Promise.resolve().then(function(){return eo}),Promise.resolve().then(function(){return to}),Promise.resolve().then(function(){return oo}),Promise.resolve().then(function(){return so}),Promise.resolve().then(function(){return wi}),Promise.resolve().then(function(){return $i}),Promise.resolve().then(function(){return Oi}),Promise.resolve().then(function(){return Ni}),Promise.resolve().then(function(){return zi}),Promise.resolve().then(function(){return Fi}),Promise.resolve().then(function(){return Zi}),Promise.resolve().then(function(){return Xi}),Promise.resolve().then(function(){return Do}),Promise.resolve().then(function(){return bs}),Promise.resolve().then(function(){return as}),Promise.resolve().then(function(){return _s}),Promise.resolve().then(function(){return Vo}),Promise.resolve().then(function(){return As}),Promise.resolve().then(function(){return Lr}),Promise.resolve().then(function(){return Ls}),Promise.resolve().then(function(){return Ds}),Promise.resolve().then(function(){return Ms}),Promise.resolve().then(function(){return Hs}),Promise.resolve().then(function(){return Gs}),Promise.resolve().then(function(){return Qs}),Promise.resolve().then(function(){return Js}),Promise.resolve().then(function(){return oa}),Promise.resolve().then(function(){return ca}),Promise.resolve().then(function(){return da}),Promise.resolve().then(function(){return ha}),Promise.resolve().then(function(){return ka}),Promise.resolve().then(function(){return Ea}),Promise.resolve().then(function(){return Ra}),Promise.resolve().then(function(){return Ta}),Promise.resolve().then(function(){return Na}),Promise.resolve().then(function(){return Ma}),Promise.resolve().then(function(){return Ua}),Promise.resolve().then(function(){return Za}),Promise.resolve().then(function(){return Xa}),Promise.resolve().then(function(){return el}),Promise.resolve().then(function(){return rl}),Promise.resolve().then(function(){return sl})];Promise.all(pr).then(e=>dr(e)).catch(e=>console.error(e));var hr=Object.freeze({__proto__:null,default:'// ReSpec Worker\n"use strict";\n// hljs is either inlined by core/worker.js (preferred) or loaded below via\n// importScripts as a fallback when the inline fetch was not possible.\nif (typeof self.hljs === "undefined" && self.RESPEC_HIGHLIGHT_URL) {\n try {\n importScripts(self.RESPEC_HIGHLIGHT_URL);\n } catch (err) {\n console.error("Network error loading highlighter", err);\n }\n}\n\nself.addEventListener("message", ({ data }) => {\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, langScript, propName, lang } = data;\n console.warn(\n `[ReSpec] The "highlight-load-lang" worker action is deprecated ` +\n `and will be removed in a future version. ` +\n `To migrate, fetch your language script in the main thread and ` +\n `send the text as "langScript" instead of "langURL". ` +\n `The "langURL" path may fail in Firefox. ` +\n `See https://github.com/speced/respec/issues/5228`\n );\n try {\n if (langScript) {\n const blob = new Blob([langScript], {\n type: "application/javascript",\n });\n const objectURL = URL.createObjectURL(blob);\n try {\n importScripts(objectURL);\n } finally {\n URL.revokeObjectURL(objectURL);\n }\n } else if (langURL) {\n const { protocol, hostname } = new URL(langURL);\n const isSecure =\n protocol === "https:" ||\n (protocol === "http:" &&\n (hostname === "localhost" ||\n hostname === "127.0.0.1" ||\n hostname === "[::1]"));\n if (!isSecure) {\n throw new Error(\n `langURL must be https: or http: on localhost, got "${langURL}"`\n );\n }\n importScripts(langURL);\n } else {\n throw new Error(\n `No langScript or langURL provided for language "${lang}"`\n );\n }\n if (typeof self[propName] === "function") {\n self.hljs.registerLanguage(lang, self[propName]);\n } else {\n throw new Error(\n `Language definer "${propName}" is not a function on self`\n );\n }\n } catch (err) {\n console.error("Failed to load or register language", lang, err);\n }\n delete data.langScript;\n delete data.langURL;\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 Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'});var fr=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then(()=>{let e=decodeURIComponent(window.location.hash).slice(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)}window.location.hash=`#${e}`})}});const mr={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,"no-dfn-in-abstract":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0};const gr=new Map([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),br={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 yr=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...mr.lint,...br.lint,...e.lint};Object.assign(e,{...mr,...br,...e,lint:t}),function(e){if(!e.hasOwnProperty("noToc"))return;e.noTOC??=e.noToc,dn("The `noToc` configuration option is deprecated.","core/defaults",{hint:mn`Please use ${"[noTOC]"} instead.`})}(e),Object.assign(e,function(e){return{licenseInfo:gr.get(e.license)}}(e))}});const wr=String.raw,vr=String.raw`color-mix(in srgb, #eaf3ff 15%, transparent)`;const kr=zn(wr`@keyframes pop{
98
98
  0%{transform:scale(1,1)}
99
99
  25%{transform:scale(1.25,1.25);opacity:.75}
100
100
  100%{transform:scale(1,1)}
@@ -110,9 +110,9 @@ a.bibref{text-decoration:none}
110
110
  }
111
111
  #references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1}
112
112
  @media (prefers-color-scheme:dark){
113
- #references :target{background:${wr}}
113
+ #references :target{background:${vr}}
114
114
  }
115
- body:has(input[name=color-scheme][value=dark]:checked) #references :target{background:${wr}}
115
+ body:has(input[name=color-scheme][value=dark]:checked) #references :target{background:${vr}}
116
116
  cite .bibref{font-style:italic}
117
117
  a[href].orcid{padding-left:4px;padding-right:4px}
118
118
  a[href].orcid>svg{margin-bottom:-2px}
@@ -141,14 +141,14 @@ dd{margin-left:0}
141
141
  .removeOnSave{display:none}
142
142
  }
143
143
  body:has(input[name=color-scheme][value=light]:checked),head:not(:has(meta[name=color-scheme][content~=dark]))+body{color-scheme:light}
144
- body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"respec-mainstyle"});var kr=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&vr.remove()}});const xr="aom/style";const $r=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(It))t.appendChild(n);return t}();$r.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]")||$r.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($r);var Er=Object.freeze({__proto__:null,name:xr,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",an(t,xr)}let t;if("PD"===e.specStatus.toUpperCase())t="W3C-UD";else t="base.css";e.noTOC||mn("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),mn("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);t&&e.querySelector("head")?.append(t)}))}});class Sr{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}static sectionClasses=new Set(["appendix","informative","notoc"]);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,this.processHeader(e,t)}processHeader(e,t){Sr.sectionClasses.intersection(new Set(e.classList)).forEach((e=>{t.classList.add(e)}))}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(_r(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function _r(e){const t=new Sr(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 Cr(e){const t=_r(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 Lr=Object.freeze({__proto__:null,name:"core/sections",restructure:Cr,run:function(){Cr(document.body)}});const Ar="core/data-include";function Tr(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`);if(!r)return;const o=Ut(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=Hn(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&Cr(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","data-oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function Rr(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);if(!o.ok)throw new Error(`Fetching \`${n}\` failed with status code ${o.status} (${o.statusText}).`);Tr(await o.text(),r,n),t<3&&await Rr(e,t+1)}catch(t){const r=t;sn(`\`data-include\` failed: \`${n}\` (${r.message}). Please check that the URL is correct and reachable.`,Ar,{elements:[e],cause:r})}}));await Promise.all(r)}var Nr=Object.freeze({__proto__:null,name:Ar,run:async function(){await Rr(document,1)}});var Or=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=pn(e.innerHTML)}});const Pr="core/title",Ir=Ft({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"},cs:{default_title:"Bez názvu"},fr:{default_title:"Sans titre"}});var jr=Object.freeze({__proto__:null,name:Pr,run:function(e){const t=document.querySelector("h1#title")||$t`<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">`.',Pr,{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||`${Ir.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=Bt(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=$t`
144
+ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"respec-mainstyle"});var xr=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&kr.remove()}});const $r="aom/style";const Er=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(Mt))t.appendChild(n);return t}();Er.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]")||Er.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(Er);var Sr=Object.freeze({__proto__:null,name:$r,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",dn(t,$r)}let t;if("PD"===e.specStatus.toUpperCase())t="W3C-UD";else t="base.css";e.noTOC||wn("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),wn("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);t&&e.querySelector("head")?.append(t)}))}});class _r{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}static sectionClasses=new Set(["appendix","informative","notoc"]);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,this.processHeader(e,t)}processHeader(e,t){_r.sectionClasses.intersection(new Set(e.classList)).forEach(e=>{t.classList.add(e)})}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Cr(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Cr(e){const t=new _r(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 Ar(e){const t=Cr(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 Lr=Object.freeze({__proto__:null,name:"core/sections",restructure:Ar,run:function(){Ar(document.body)}});const Rr="core/data-include";function Tr(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`);if(!r)return;const o=Zt(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=Fn(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&Ar(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","data-oninclude"].forEach(t=>e.removeAttribute(t))}(r)}async function Pr(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);if(!o.ok)throw new Error(`Fetching \`${n}\` failed with status code ${o.status} (${o.statusText}).`);Tr(await o.text(),r,n),t<3&&await Pr(e,t+1)}catch(t){const r=t;un(`\`data-include\` failed: \`${n}\` (${r.message}). Please check that the URL is correct and reachable.`,Rr,{elements:[e],cause:r})}});await Promise.all(r)}var Or=Object.freeze({__proto__:null,name:Rr,run:async function(){await Pr(document,1)}});var Nr=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=gn(e.innerHTML)}});const Ir="core/title",jr=Vt({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"},cs:{default_title:"Bez názvu"},fr:{default_title:"Sans titre"}});var Dr=Object.freeze({__proto__:null,name:Ir,run:function(e){const t=document.querySelector("h1#title")||At`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){un('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">`.',Ir,{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||`${jr.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=Gt(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=At`
145
145
  Preview of PR <a href="${n}">#${e.prNumber}</a>:
146
- `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function Dr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return an(t,"core/templates/show-link"),void console.warn(t,e)}return $t`
146
+ `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function zr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return dn(t,"core/templates/show-link"),void console.warn(t,e)}return At`
147
147
  <dt class="${e.class?e.class:null}">${e.key}</dt>
148
- ${e.data?e.data.map(zr):zr(e)}
149
- `}function zr(e){return $t`<dd class="${e.class?e.class:null}">
150
- ${e.href?$t`<a href="${e.href}">${e.value||e.href}</a>`:e.value}
151
- </dd>`}const Mr="core/templates/show-logo";function qr(e,t){const n=$t`<a href="${e.url||null}" class="logo"
148
+ ${e.data?e.data.map(Mr):Mr(e)}
149
+ `}function Mr(e){return At`<dd class="${e.class?e.class:null}">
150
+ ${e.href?At`<a href="${e.href}">${e.value||e.href}</a>`:e.value}
151
+ </dd>`}const qr="core/templates/show-logo";function Hr(e,t){const n=At`<a href="${e.url||null}" class="logo"
152
152
  ><img
153
153
  alt="${e.alt||null}"
154
154
  crossorigin
@@ -157,7 +157,7 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
157
157
  src="${e.src||null}"
158
158
  width="${e.width||null}"
159
159
  />
160
- </a>`;if(!e.alt){const r=dn`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.`,Mr,{hint:r,elements:[n]})}if(!e.src){const e=dn`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;sn(`Logo at index ${t} is missing "\`src\`" property.`,Mr,{hint:e,elements:[n]})}return n}const Hr="core/templates/show-people",Br=Ft({en:{until:e=>$t` Until ${e} `},es:{until:e=>$t` Hasta ${e} `},ko:{until:e=>$t` ${e} 이전 `},ja:{until:e=>$t` ${e} 以前 `},de:{until:e=>$t` bis ${e} `},zh:{until:e=>$t` 直到 ${e} `}}),Fr=()=>$t`<svg
160
+ </a>`;if(!e.alt){const r=mn`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;un(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,qr,{hint:r,elements:[n]})}if(!e.src){const e=mn`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;un(`Logo at index ${t} is missing "\`src\`" property.`,qr,{hint:e,elements:[n]})}return n}const Br="core/templates/show-people",Fr=Vt({en:{until:e=>At` Until ${e} `},es:{until:e=>At` Hasta ${e} `},ko:{until:e=>At` ${e} 이전 `},ja:{until:e=>At` ${e} 以前 `},de:{until:e=>At` bis ${e} `},zh:{until:e=>At` 直到 ${e} `}});function Ur(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 un(`${i} Missing required property \`"name"\`.`,Br,{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 un(n,Br,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return un(`${i} ORCID "${o}" has wrong format.`,Br,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter(e=>/\d/.test(e)).map(Number).reduce((e,t)=>2*(e+t),0),r=(12-n%11)%11,o=10===r?"X":String(r);return t===o}(n))return un(`${i} ORCID "${n}" failed checksum check.`,Br,{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())?(un(`${i} The property "\`retiredDate\`" is not a valid date.`,Br,{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 un(`${n}. Member "extra" at index ${r} is not an object.`,Br,{hint:t}),!1;case!e.hasOwnProperty("name"):return un(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Br,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return un(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Br,{hint:t}),!1}return!0}):(un(`${n}. A person's "extras" member must be an array.`,Br,{hint:t}),!1)}(e.extras??[],r,i))&&(e.url&&e.mailto&&dn(`${i} Has both "url" and "mailto" property.`,Br,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&dn(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,Br,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var s});var o;return n.filter(r).map(Wr)}function Wr(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(At`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(At`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(At`<a class="p-name orcid" href="${e.orcid}">${At`<svg
161
161
  width="16"
162
162
  height="16"
163
163
  xmlns="http://www.w3.org/2000/svg"
@@ -176,15 +176,15 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
176
176
  class="st1"
177
177
  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"
178
178
  />
179
- </svg>`;function Ur(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.`,s=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return sn(`${s} Missing required property \`"name"\`.`,Hr,{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=`${s} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return sn(n,Hr,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return sn(`${s} ORCID "${o}" has wrong format.`,Hr,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0),r=(12-n%11)%11,o=10===r?"X":String(r);return t===o}(n))return sn(`${s} ORCID "${n}" failed checksum check.`,Hr,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(i=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(i)?new Date(i):"Invalid Date").toString())?(sn(`${s} The property "\`retiredDate\`" is not a valid date.`,Hr,{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.`,Hr,{hint:t}),!1;case!e.hasOwnProperty("name"):return sn(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Hr,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return sn(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Hr,{hint:t}),!1}return!0})):(sn(`${n}. A person's "extras" member must be an array.`,Hr,{hint:t}),!1)}(e.extras??[],r,s))&&(e.url&&e.mailto&&an(`${s} Has both "url" and "mailto" property.`,Hr,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&an(`${s} Has a "\`companyURL\`" property but no "\`company\`" property.`,Hr,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var i});var o;return n.filter(r).map(Wr)}function Wr(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($t`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push($t`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push($t`<a class="p-name orcid" href="${e.orcid}">${Fr()}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?$t`<a class="${t}" href="${e.companyURL}">${n}</a>`:$t`<span class="${t}">${n}</span>`;o.push($t` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>$t`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?$t`<a href="${r}" class="${t}">${n}</a>`:$t`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:s}=e;if(e.retiredDate){const e=$t`<time datetime="${s}"
180
- >${Ot.format(new Date(s??""))}</time
181
- >`;o.push($t` - ${Br.until(e)} `)}return $t`<dd
179
+ </svg>`}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?At`<a class="${t}" href="${e.companyURL}">${n}</a>`:At`<span class="${t}">${n}</span>`;o.push(At` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map(e=>At`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?At`<a href="${r}" class="${t}">${n}</a>`:At`<span class="${t}">${n}</span>`}(e)}`));const{retiredDate:i}=e;if(e.retiredDate){const e=At`<time datetime="${i}"
180
+ >${zt.format(new Date(i??""))}</time
181
+ >`;o.push(At` - ${Fr.until(e)} `)}return At`<dd
182
182
  class="editor p-author h-card vcard"
183
183
  data-editor-id="${r}"
184
184
  >
185
185
  ${o}
186
- </dd>`}const Gr=Ft({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 Vr=e=>$t`<div class="head">
187
- ${"PD"!==e.specStatus?(e.logos??[]).map(qr):""}
186
+ </dd>`}const Gr=Vt({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 Vr=e=>At`<div class="head">
187
+ ${"PD"!==e.specStatus?(e.logos??[]).map(Hr):""}
188
188
  ${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)}
189
189
  <h2>
190
190
  ${e.textStatus} -
@@ -203,19 +203,19 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
203
203
  </dd>
204
204
  <dt>${e.multipleEditors?Gr.editors:Gr.editor}</dt>
205
205
  ${Ur(e,"editors")}
206
- ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?$t`
206
+ ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?At`
207
207
  <dt>
208
208
  ${e.multipleFormerEditors?Gr.former_editors:Gr.former_editor}
209
209
  </dt>
210
210
  ${Ur(e,"formerEditors")}
211
211
  `:""}
212
- ${e.authors?$t`
212
+ ${e.authors?At`
213
213
  <dt>${e.multipleAuthors?Gr.authors:Gr.author}</dt>
214
214
  ${Ur(e,"authors")}
215
215
  `:""}
216
- ${e.otherLinks?e.otherLinks.map(Dr):""}
216
+ ${e.otherLinks?e.otherLinks.map(zr):""}
217
217
  </dl>
218
- ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;return $t`<p class="copyright">
218
+ ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;return At`<p class="copyright">
219
219
  Copyright ${e.publishYear},
220
220
  <a href="https://www.w3.org/"
221
221
  ><abbr title="The Alliance for Open Media">AOM</abbr></a
@@ -236,78 +236,78 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
236
236
  DAMAGE.
237
237
  </p>`}(e)}
238
238
  <hr />
239
- </div>`;const Zr="aom/headers",Yr={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},Kr=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var Qr=Object.freeze({__proto__:null,name:Zr,run:function(e){if(!e.specStatus){sn("Missing required configuration: `specStatus`",Zr)}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=Rt.format(r);return new Date(e)}return sn(`[\`${t}\`](https://github.com/speced/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,Zr),new Date(Rt.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=Kr.format(e.publishDate);const t=function(e){if(!e.name){sn("All authors and editors must have a name.",Zr)}};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){sn("At least one editor is required",Zr)}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=Yr[e.specStatus],e.dashDate=Rt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=Vr(e);document.body.prepend(n),document.body.classList.add("h-entry"),fn("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const Xr="aom/abstract",Jr=Ft({en:{abstract:"Abstract"}});var eo=Object.freeze({__proto__:null,name:Xr,run:async function(){const e=document.getElementById("abstract");if(!e){return void sn('Document must have one element with `id="abstract"',Xr)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=Jr.abstract,e.prepend(t))}});var to=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Ut(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const no="core/dfn-abbr";function ro(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(),o=document.createElement("abbr");o.title=r,o.textContent=t,e.after(" (",o,")");const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter((e=>e.trim())).concat(t).join("|")}var oo=Object.freeze({__proto__:null,name:no,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)ro(t);else{sn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,no,{elements:[t],title:"Error: unsupported."})}}}});var so=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black}
239
+ </div>`;const Zr="aom/headers",Yr={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},Kr=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var Xr=Object.freeze({__proto__:null,name:Zr,run:function(e){if(!e.specStatus){un("Missing required configuration: `specStatus`",Zr)}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=jt.format(r);return new Date(e)}return un(`[\`${t}\`](https://github.com/speced/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,Zr),new Date(jt.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=Kr.format(e.publishDate);const t=function(e){if(!e.name){un("All authors and editors must have a name.",Zr)}};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){un("At least one editor is required",Zr)}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=Yr[e.specStatus],e.dashDate=jt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=Vr(e);document.body.prepend(n),document.body.classList.add("h-entry"),yn("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const Qr="aom/abstract",Jr=Vt({en:{abstract:"Abstract"}});var eo=Object.freeze({__proto__:null,name:Qr,run:async function(){const e=document.getElementById("abstract");if(!e){return void un('Document must have one element with `id="abstract"',Qr)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=Jr.abstract,e.prepend(t))}});var to=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=Zt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const no="core/dfn-abbr";function ro(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(),o=document.createElement("abbr");o.title=r,o.textContent=t,e.after(" (",o,")");const i=e.dataset.lt||"";e.dataset.lt=i.split("|").filter(e=>e.trim()).concat(t).join("|")}var oo=Object.freeze({__proto__:null,name:no,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)ro(t);else{un(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,no,{elements:[t],title:"Error: unsupported."})}}}});var io=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black}
240
240
  .assert{border-left:.5em solid #aaa;padding:.3em;border-color:#aaa;border-color:var(--assertion-border);background:#eee;background:var(--assertion-bg);color:#000;color:var(--assertion-text)}
241
241
  @media (prefers-color-scheme:dark){
242
242
  :root{--assertion-border:#444;--assertion-bg:var(--borderedblock-bg);--assertion-text:var(--text)}
243
- }`;var io=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){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($t`<a data-cite="INFRA#assert">Assert</a>`,": "))}jn(so)}}});const ao=/^[a-z]+(\s+[a-z]+)+\??$/,lo=/\B"([^"]*)"\B/,co=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,uo=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,po=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,ho=/^(?:\w+)\??$/,fo=/^(\w+)\["([\w- ]*)"\]$/,mo=/\.?(\w+\(.*\)$)/,go=/\/(.+)/,bo=/\[\[.+\]\]/;function yo(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return $t`<a
243
+ }`;var so=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter(e=>e.textContent.trim().startsWith("Assert: "));if(e.length){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(At`<a data-cite="INFRA#assert">Assert</a>`,": "))}zn(io)}}});const ao=/^[a-z]+(\s+[a-z]+)+\??$/,lo=/\B"([^"]*)"\B/,co=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,uo=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,po=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,ho=/^(?:\w+)\??$/,fo=/^(\w+)\["([\w- ]*)"\]$/,mo=/\.?(\w+\(.*\)$)/,go=/\/(.+)/,bo=/\[\[.+\]\]/;function yo(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return At`<a
244
244
  data-xref-type="_IDL_"
245
245
  data-link-type="idl"
246
246
  data-lt="${t}"
247
247
  ><code>${t+(r?"?":"")}</code></a
248
- >`}function wo(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,l=s??[],c=a?$t`(${Wt(l,vo)})`:null,u=a?`(${l.join(", ")})`:"";return $t`${n&&o?".":""}<a
248
+ >`}function wo(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:s}=n||{},a="method"===r,l=i??[],c=a?At`(${Yt(l,vo)})`:null,u=a?`(${l.join(", ")})`:"";return At`${n&&o?".":""}<a
249
249
  data-xref-type="${r}"
250
250
  data-link-type="${r}"
251
- data-link-for="${i}"
252
- data-xref-for="${i}"
251
+ data-link-for="${s}"
252
+ data-xref-for="${s}"
253
253
  data-lt="${`[[${t}]]${u}`}"
254
254
  ><code>[[${t}]]${c}</code></a
255
- >`}function vo(e,t,n){if(t<n.length-1)return $t`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return $t`${o?"...":null}<var>${s}</var>`}function ko(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return $t`${r?".":""}<a
255
+ >`}function vo(e,t,n){if(t<n.length-1)return At`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return At`${o?"...":null}<var>${i}</var>`}function ko(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return At`${r?".":""}<a
256
256
  data-link-type="idl"
257
257
  data-xref-type="attribute|dict-member|const"
258
258
  data-link-for="${o}"
259
259
  data-xref-for="${o}"
260
260
  ><code>${n}</code></a
261
- >`}function xo(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:l}=o||{},c=Wt(a||t,vo),u=`${n}(${t.join(", ")})`;return $t`${o&&s?".":""}<a
261
+ >`}function xo(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{renderText:s,renderArgs:a}=e,{identifier:l}=o||{},c=Yt(a||t,vo),u=`${n}(${t.join(", ")})`;return At`${o&&i?".":""}<a
262
262
  data-link-type="idl"
263
263
  data-xref-type="${r}"
264
264
  data-link-for="${l}"
265
265
  data-xref-for="${l}"
266
266
  data-lt="${u}"
267
- ><code>${i||n}</code></a
268
- >${!i||a?$t`<code>(${c})</code>`:""}`}function $o(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return $t`"<a
267
+ ><code>${s||n}</code></a
268
+ >${!s||a?At`<code>(${c})</code>`:""}`}function $o(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return At`"<a
269
269
  data-link-type="idl"
270
270
  data-xref-type="enum-value"
271
271
  data-link-for="${o}"
272
272
  data-xref-for="${o}"
273
273
  data-lt="${n?null:"the-empty-string"}"
274
274
  ><code>${n}</code></a
275
- >"`}function Eo(e){const{identifier:t}=e;return $t`"<a
275
+ >"`}function Eo(e){const{identifier:t}=e;return At`"<a
276
276
  data-link-type="idl"
277
277
  data-cite="webidl"
278
278
  data-xref-type="exception"
279
279
  ><code>${t}</code></a
280
- >"`}function So(e){const{identifier:t,nullable:n}=e;return $t`<a
280
+ >"`}function So(e){const{identifier:t,nullable:n}=e;return At`<a
281
281
  data-link-type="idl"
282
282
  data-cite="webidl"
283
283
  data-xref-type="interface"
284
284
  data-lt="${t}"
285
285
  ><code>${t+(n?"?":"")}</code></a
286
- >`}function _o(e){let t;try{t=function(e){const t=bo.test(e),n=t?go:mo,[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(co.test(t)){const[,e,n,r,o]=t.match(co),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(fo.test(t)){const[,e,n]=t.match(fo);a.push({type:"enum",identifier:e??"",enumValue:n??"",renderParent:i})}else if(lo.test(t)){const[,e]=t.match(lo);i?a.push({type:"exception",identifier:e??""}):a.push({type:"enum",enumValue:e??"",renderParent:i})}else if(uo.test(t)){const[,e,n]=t.match(uo),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(po.test(t)&&s.length){const[,e]=t.match(po);a.push({type:"attribute",identifier:e??"",renderParent:i})}else if(ao.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(!ho.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=$t`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return sn(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=$t(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=yo(e);t&&r.push(t);break}case"attribute":r.push(ko(e));break;case"internal-slot":r.push(wo(e));break;case"method":r.push(xo(e));break;case"enum":r.push($o(e));break;case"exception":r.push(Eo(e));break;case"idl-primitive":r.push(So(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Co=new Set(["alias","reference"]),Lo=async function(){const e=await Et.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[...Co]){const r=e.transaction(n,"readwrite"),o=IDBKeyRange.lowerBound(t),s=async()=>{let e=await r.store.openCursor(o);for(;e?.value;){const n=e.value;(void 0===n.expires||n.expires<t)&&await r.store.delete(n.id),e=await e.continue()}};await Promise.all([s(),r.done])}return e}();const Ao={get ready(){return Lo},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)??e),await this.get("reference",e)},async has(e,t){if(!Co.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:null},async get(e,t){if(!Co.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:null},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=[...Co].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Co.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){const o=await this.get(e,t.id);if(o&&void 0!==o.expires&&o.expires<Date.now()){const o=n.transaction(e,"readwrite");await Promise.all([o.store.delete(t.id),o.done]),r=!1}}const o=n.transaction(e,"readwrite"),[s]=await Promise.all([r?o.store.put(t):o.store.add(t),o.done]);return s},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Co],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all([...r,n.done])}},To={},Ro=[new URL("https://api.specref.org/bibrefs?refs="),new URL("https://respec.org/bibrefs?refs=")],No=2e3,Oo=It({hint:"dns-prefetch",href:Ro[0].origin});let Po;document.head.appendChild(Oo);const Io=new Promise((e=>{Po=e}));async function jo(e){const t=[...new Set(e)].filter((e=>e.trim()));if(!t.length||!1===navigator.onLine)return null;const n=await async function(e){for(const t of Ro){let n;try{n=await fetch(t.href+e,{signal:AbortSignal.timeout(No)})}catch(e){console.warn(`Could not reach ${t.origin} for references.`,e);continue}if(200===n.status)try{return{data:await n.json(),expires:n.headers.get("Expires")}}catch(e){console.warn(`${t.origin} sent references that are not JSON.`,e)}else console.warn(`${t.origin} answered ${n.status} for references.`)}return null}(t.join(","));if(!n)return null;const{data:r,expires:o}=n,s=Date.now()+36e5;try{const e=Date.parse(o||""),t=Number.isNaN(e)?s:Math.min(e,s);await Ao.addAll(r,t)}catch(e){console.error(e)}return r}async function Do(e){const t=await Io;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Do(n.aliasOf):n}var zo=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=To;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio?.[e]?.hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio?.[e]?.aliasOf)).filter((e=>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.filter(Boolean)).sort())),r=n.length?await async function(e){const t=[];try{await Ao.ready;const n=e.map((async e=>({id:e,data:await Ao.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=>{e.data&&(To[e.id]=e.data)}));const s=o.noData.map((e=>e.id));if(s.length){const e=await jo(s);Object.assign(To,e)}Object.assign(To,this.conf.localBiblio),(()=>{Po(this.conf.biblio)})()}},biblio:To,name:"core/biblio",resolveRef:Do,updateFromNetwork:jo});const Mo="core/render-biblio";function qo(e){return`bib-${Gt(e)}`}const Ho=Ft({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."},fr:{info_references:"Références informatives",norm_references:"Références normatives",references:"Références",reference_not_found:"Référence non trouvée."},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:"参考文献"},cs:{info_references:"Informativní odkazy",norm_references:"Normativní odkazy",references:"Odkazy",reference_not_found:"Odkaz nebyl nalezen."}}),Bo=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]);function Fo(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(Uo)),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=$t`<section>
286
+ >`}function _o(e){let t;try{t=function(e){const t=bo.test(e),n=t?go:mo,[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(co.test(t)){const[,e,n,r,o]=t.match(co),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});continue}if(fo.test(t)){const[,e,n]=t.match(fo);a.push({type:"enum",identifier:e??"",enumValue:n??"",renderParent:s});continue}if(lo.test(t)){const[,e]=t.match(lo);s?a.push({type:"exception",identifier:e??""}):a.push({type:"enum",enumValue:e??"",renderParent:s});continue}if(uo.test(t)){const[,e,n]=t.match(uo),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});continue}if(po.test(t)&&i.length){const[,e]=t.match(po);a.push({type:"attribute",identifier:e??"",renderParent:s});continue}if(ao.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:s,nullable:e});continue}if(ho.test(t)&&0===i.length){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:s,nullable:e});continue}throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``)}return a.forEach((e,t,n)=>{e.parent=n[t+1]||null}),a.reverse()}(e)}catch(t){const n=At`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return un(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=At(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=yo(e);t&&r.push(t);break}case"attribute":r.push(ko(e));break;case"internal-slot":r.push(wo(e));break;case"method":r.push(xo(e));break;case"enum":r.push($o(e));break;case"exception":r.push(Eo(e));break;case"idl-primitive":r.push(So(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Co=new Set(["alias","reference"]),Ao=async function(){const e=await Lt.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[...Co]){const r=e.transaction(n,"readwrite"),o=IDBKeyRange.lowerBound(t),i=async()=>{let e=await r.store.openCursor(o);for(;e?.value;){const n=e.value;(void 0===n.expires||n.expires<t)&&await r.store.delete(n.id),e=await e.continue()}};await Promise.all([i(),r.done])}return e}();const Lo={get ready(){return Ao},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)??e),await this.get("reference",e)},async has(e,t){if(!Co.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:null},async get(e,t){if(!Co.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:null},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=[...Co].flatMap(e=>n[e].map(t=>this.add(e,t)));await Promise.all(r)},async add(e,t){if(!Co.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){const o=await this.get(e,t.id);if(o&&void 0!==o.expires&&o.expires<Date.now()){const o=n.transaction(e,"readwrite");await Promise.all([o.store.delete(t.id),o.done]),r=!1}}const o=n.transaction(e,"readwrite"),[i]=await Promise.all([r?o.store.put(t):o.store.add(t),o.done]);return i},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Co],n=e.transaction(t,"readwrite"),r=t.map(e=>n.objectStore(e).clear());await Promise.all([...r,n.done])}},Ro={},To=[new URL("https://api.specref.org/bibrefs?refs="),new URL("https://respec.org/bibrefs?refs=")],Po=Mt({hint:"dns-prefetch",href:To[0].origin});let Oo;document.head.appendChild(Po);const No=new Promise(e=>{Oo=e});async function Io(e){const t=[...new Set(e)].filter(e=>e.trim());if(!t.length||!1===navigator.onLine)return null;const n=await async function(e){for(const t of To){let n;try{n=await fetch(t.href+e,{signal:AbortSignal.timeout(2e3)})}catch(e){console.warn(`Could not reach ${t.origin} for references.`,e);continue}if(200===n.status)try{return{data:await n.json(),expires:n.headers.get("Expires")}}catch(e){console.warn(`${t.origin} sent references that are not JSON.`,e)}else console.warn(`${t.origin} answered ${n.status} for references.`)}return null}(t.join(","));if(!n)return null;const{data:r,expires:o}=n,i=Date.now()+36e5;try{const e=Date.parse(o||""),t=Number.isNaN(e)?i:Math.min(e,i);await Lo.addAll(r,t)}catch(e){console.error(e)}return r}async function jo(e){const t=await No;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await jo(n.aliasOf):n}var Do=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=Ro;const e=Object.keys(this.conf.localBiblio).filter(e=>this.conf.localBiblio?.[e]?.hasOwnProperty("aliasOf")).map(e=>this.conf.localBiblio?.[e]?.aliasOf).filter(e=>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.filter(Boolean)).sort())),r=n.length?await async function(e){const t=[];try{await Lo.ready;const n=e.map(async e=>({id:e,data:await Lo.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=>{e.data&&(Ro[e.id]=e.data)});const i=o.noData.map(e=>e.id);if(i.length){const e=await Io(i);Object.assign(Ro,e)}Object.assign(Ro,this.conf.localBiblio),(()=>{Oo(this.conf.biblio)})()}},biblio:Ro,name:"core/biblio",resolveRef:jo,updateFromNetwork:Io});const zo="core/render-biblio";function Mo(e){return`bib-${Kt(e)}`}const qo=Vt({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."},fr:{info_references:"Références informatives",norm_references:"Références normatives",references:"Références",reference_not_found:"Référence non trouvée."},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:"参考文献"},cs:{info_references:"Informativní odkazy",norm_references:"Normativní odkazy",references:"Odkazy",reference_not_found:"Odkaz nebyl nalezen."}}),Ho=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]);function Bo(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(Fo)),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=At`<section>
287
287
  <h3>${t}</h3>
288
- <dl class="bibliography">${s.map(Go)}</dl>
289
- </section>`;Vt(i,"",t);const a=function(e){const t=new Map;for(const n of e){const e=n.refcontent?.id??"",r=t.has(e)?t.get(e):t.set(e,[]).get(e);r?.push(n.ref)}return t}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#${qo(e)}`,o=(t.get(n.id??"")??[]).map((e=>`a.bibref[href="#${qo(e)}"]`)).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="#${qo(t)}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));sn(`Reference "[${t}]" not found.`,Mo,{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 Uo(e){let t=To[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}\`].`,Mo)}else n=t.aliasOf,t=To[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Wo(e,t){const n=e.replace(/^(!|\?)/,""),r=`#${qo(n)}`,o=$t`<cite
288
+ <dl class="bibliography">${i.map(Wo)}</dl>
289
+ </section>`;Xt(s,"",t);const a=function(e){const t=new Map;for(const n of e){const e=n.refcontent?.id??"",r=t.has(e)?t.get(e):t.set(e,[]).get(e);r?.push(n.ref)}return t}(n);return function(e,t){e.map(({ref:e,refcontent:n})=>{const r=`#${Mo(e)}`,o=(t.get(n.id??"")??[]).map(e=>`a.bibref[href="#${Mo(e)}"]`).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="#${Mo(t)}"]`)].filter(({textContent:e})=>e.toLowerCase()===t.toLowerCase());un(`Reference "[${t}]" not found.`,zo,{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 Fo(e){let t=Ro[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;un(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,zo)}else n=t.aliasOf,t=Ro[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Uo(e,t){const n=e.replace(/^(!|\?)/,""),r=`#${Mo(n)}`,o=At`<cite
290
290
  ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite
291
- >`;return t?o:$t`[${o}]`}function Go(e){const{ref:t,refcontent:n}=e,r=qo(t);return $t`
291
+ >`;return t?o:At`[${o}]`}function Wo(e){const{ref:t,refcontent:n}=e,r=Mo(t);return At`
292
292
  <dt id="${r}">[${t}]</dt>
293
293
  <dd>
294
- ${n?{html:Vo(n)}:$t`<em class="respec-offending-element"
295
- >${Ho.reference_not_found}</em
294
+ ${n?{html:Go(n)}:At`<em class="respec-offending-element"
295
+ >${qo.reference_not_found}</em
296
296
  >`}
297
297
  </dd>
298
- `}function Vo(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;if(t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors){if(!Array.isArray(e.authors)){const t=`The "authors" field in reference "${e.id||e.title}" must be an array.`,n=`Use \`authors: [${JSON.stringify(e.authors)}]\` instead of \`authors: ${JSON.stringify(e.authors)}\`.`;sn(t,Mo,{hint:n}),e.authors=[e.authors]}e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". "))}if(e.publisher){const n=e.pages?",":".",r=e.publisher.trim();t=`${t} ${r.endsWith(".")?r.slice(0,-1):r}${n} `}return e.pages&&(t+=`pp. ${Ht(e.pages)}. `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Bo.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Zo=Object.freeze({__proto__:null,name:Mo,renderInlineCitation:Wo,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")||$t`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend($t`<h1>${Ho.references}</h1>`),r.classList.add("appendix"),n.length){const e=Fo(n,Ho.norm_references);r.appendChild(e)}if(t.length){const e=Fo(t,Ho.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Yo="core/inlines",Ko={},Qo=e=>new RegExp(e.map((e=>e.source)).join("|")),Xo=Ft({en:{rfc2119Keywords:()=>Qo([/\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:()=>Qo([/\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/])}}),Jo=/(?:`[^`]+`)(?!`)/,es=/(?:{{[^}]+\?*}})/,ts=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,ns=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,rs=/(?:\[\[\[[^\]]+\]\]\])/,os=/(?:\[=[^=]+=\])/,ss=/(?:\[\^[^^]+\^\])/,is=/(?:\{\^[^}^]+\^\})/;function as(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 $t`<code
298
+ `}function Go(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;if(t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors){if(!Array.isArray(e.authors)){const t=`The "authors" field in reference "${e.id||e.title}" must be an array.`,n=`Use \`authors: [${JSON.stringify(e.authors)}]\` instead of \`authors: ${JSON.stringify(e.authors)}\`.`;un(t,zo,{hint:n}),e.authors=[e.authors]}e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". "))}if(e.publisher){const n=e.pages?",":".",r=e.publisher.trim();t=`${t} ${r.endsWith(".")?r.slice(0,-1):r}${n} `}return e.pages&&(t+=`pp. ${Wt(e.pages)}. `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Ho.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Vo=Object.freeze({__proto__:null,name:zo,renderInlineCitation:Uo,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")||At`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(At`<h1>${qo.references}</h1>`),r.classList.add("appendix"),n.length){const e=Bo(n,qo.norm_references);r.appendChild(e)}if(t.length){const e=Bo(t,qo.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Zo="core/inlines",Yo={},Ko=e=>new RegExp(e.map(e=>e.source).join("|")),Xo=Vt({en:{rfc2119Keywords:()=>Ko([/\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:()=>Ko([/\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/])}}),Qo=/(?:`[^`]+`)(?!`)/,Jo=/(?:{{[^}]+\?*}})/,ei=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,ti=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,ni=/(?:\[\[\[[^\]]+\]\]\])/,ri=/(?:\[=[^=]+=\])/,oi=/(?:\[\^[^^]+\^\])/,ii=/(?:\{\^[^}^]+\^\})/;function si(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 At`<code
299
299
  ><a
300
- data-xref-type="${s}"
301
- data-xref-for="${i}"
302
- data-link-type="${s}"
303
- data-link-for="${i}"
300
+ data-xref-type="${i}"
301
+ data-xref-for="${s}"
302
+ data-link-type="${i}"
303
+ data-link-for="${s}"
304
304
  >${a}</a
305
305
  ></code
306
- >`}function ls(e){const t=(e.slice(2,-2).trim().match(/"([^"]*)"|([^/]+)/g)||[]).map((e=>e.trim()));if(1===t.length){const e=t[0];return $t`<code
306
+ >`}function ai(e){const t=(e.slice(2,-2).trim().match(/"([^"]*)"|([^/]+)/g)||[]).map(e=>e.trim());if(1===t.length){const e=t[0];return At`<code
307
307
  ><a data-link-type="cddl-type" data-xref-type="cddl-type"
308
308
  >${e}</a
309
309
  ></code
310
- >`}const n=t[0],r=t[1],o=r.startsWith('"')&&r.endsWith('"')?"cddl-value":"cddl-key";return $t`<code
310
+ >`}const n=t[0],r=t[1],o=r.startsWith('"')&&r.endsWith('"')?"cddl-value":"cddl-key";return At`<code
311
311
  ><a
312
312
  data-link-type="${o}"
313
313
  data-xref-type="${o}"
@@ -315,44 +315,44 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
315
315
  data-link-for="${n}"
316
316
  >${r}</a
317
317
  ></code
318
- >`}function cs(e){const t=Bt(e),n=$t`<em class="rfc2119">${t}</em>`;return Ko[t]=!0,n}const us=/^(?:!|\\|\?)?(?:#[\w-.]+|[\w-.]+(?:#[\w-.]+)?)(?:\|[^\]]+)?$/;function ds(e){const t=e.slice(3,-3).trim();if(!us.test(t)){return an(`Bad syntax: \`${e}\` is not a valid inline expansion.`,Yo,{hint:"See https://github.com/speced/respec/wiki/inlines for valid syntax."}),e}const n=t.indexOf("|"),r=-1!==n?t.slice(n+1).trim():null,o=-1!==n?t.slice(0,n).trim():t,s=o.replace(/^[!?\\]/,"");if(o.startsWith("\\"))return`[[[${s}]]]`;if(s.startsWith("#"))return r?$t`<a href="${s}" data-matched-text="${e}"
319
- >${ys(r)}</a
320
- >`:$t`<a href="${s}" data-matched-text="${e}"></a>`;if(s.includes("#")){const[t,n]=s.split("#"),i=o.slice(0,o.length-s.length)+t;return $t`<a
321
- data-cite="${i}"
318
+ >`}function li(e){const t=Gt(e),n=At`<em class="rfc2119">${t}</em>`;return Yo[t]=!0,n}const ci=/^(?:!|\\|\?)?(?:#[\w-.]+|[\w-.]+(?:#[\w-.]+)?)(?:\|[^\]]+)?$/;function ui(e){const t=e.slice(3,-3).trim();if(!ci.test(t)){return dn(`Bad syntax: \`${e}\` is not a valid inline expansion.`,Zo,{hint:"See https://github.com/speced/respec/wiki/inlines for valid syntax."}),e}const n=t.indexOf("|"),r=-1!==n?t.slice(n+1).trim():null,o=-1!==n?t.slice(0,n).trim():t,i=o.replace(/^[!?\\]/,"");if(o.startsWith("\\"))return`[[[${i}]]]`;if(i.startsWith("#"))return r?At`<a href="${i}" data-matched-text="${e}"
319
+ >${bi(r)}</a
320
+ >`:At`<a href="${i}" data-matched-text="${e}"></a>`;if(i.includes("#")){const[t,n]=i.split("#"),s=o.slice(0,o.length-i.length)+t;return At`<a
321
+ data-cite="${s}"
322
322
  data-cite-frag="${n}"
323
323
  data-matched-text="${e}"
324
324
  data-lt="${r||null}"
325
- ></a>`}return $t`<a
325
+ ></a>`}return At`<a
326
326
  data-cite="${o}"
327
327
  data-matched-text="${e}"
328
328
  data-lt="${r||null}"
329
- ></a>`}function ps(e,t){const n=Bt(e.slice(2,-2));if(n.startsWith("\\"))return e.replace(/^(\{\{\s*)\\/,"$1");const r=_o(n);return!!t.parentElement?.closest("dfn,a")?bs(`\`${r.textContent}\``):r}function hs(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(Bt),i=o.replace(/^(!|\?)/,"");if(n.shortName&&i.toLowerCase()===n.shortName.toLowerCase()){const e=n.title||i;return[$t`<cite title="${n.shortName}">${e}</cite>`]}const{type:a,illegal:l}=Kt(o,t.parentElement),c=Wo(o,s);if(l&&!n.normativeReferences.has(i)){const e=c.childNodes[1]||c;an("Normative references in informative sections are not allowed. ",Yo,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==a||l?n.normativeReferences.add(i):n.informativeReferences.add(i),c.childNodes[1]?c.childNodes:[c]}function fs(e,t,n){return"ABBR"===t.parentElement?.tagName?e:$t`<abbr title="${n.get(e)}">${e}</abbr>`}function ms(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return $t`<var data-type="${r}">${n}</var>`}function gs(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(Bt).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=ys(s),a=n?Bt(n):null;return $t`<a
329
+ ></a>`}function di(e,t){const n=Gt(e.slice(2,-2));if(n.startsWith("\\"))return e.replace(/^(\{\{\s*)\\/,"$1");const r=_o(n);return!!t.parentElement?.closest("dfn,a")?gi(`\`${r.textContent}\``):r}function pi(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(Gt),s=o.replace(/^(!|\?)/,"");if(n.shortName&&s.toLowerCase()===n.shortName.toLowerCase()){const e=n.title||s;return[At`<cite title="${n.shortName}">${e}</cite>`]}const{type:a,illegal:l}=en(o,t.parentElement),c=Uo(o,i);if(l&&!n.normativeReferences.has(s)){const e=c.childNodes[1]||c;dn("Normative references in informative sections are not allowed. ",Zo,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==a||l?n.normativeReferences.add(s):n.informativeReferences.add(s),c.childNodes[1]?c.childNodes:[c]}function hi(e,t,n){return"ABBR"===t.parentElement?.tagName?e:At`<abbr title="${n.get(e)}">${e}</abbr>`}function fi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return At`<var data-type="${r}">${n}</var>`}function mi(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(Gt).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=bi(i),a=n?Gt(n):null;return At`<a
330
330
  data-link-type="dfn|abstract-op"
331
331
  data-link-for="${a}"
332
332
  data-xref-for="${a}"
333
333
  data-lt="${o}"
334
- >${i}</a
335
- >`}function bs(e){const t=e.slice(1,-1);return $t`<code>${t}</code>`}function ys(e){return Jo.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?bs(e):ys(e))):document.createTextNode(e)}function ws(e,t){e.textContent="";const n=ys(t);e.append(...Array.isArray(n)?n:[n])}var vs=Object.freeze({__proto__:null,name:Yo,rfc2119Usage:Ko,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Jt,e.informativeReferences=new Jt,e.respecRFC2119||(e.respecRFC2119=Ko);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=Bt(e),o=Bt(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].map((e=>Tt(e))).join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,{acceptNode: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","script","style"],{wsNodes:!1}),s=Xo.rfc2119Keywords(),i=new RegExp(`(${Qo([s,es,is,ts,ns,rs,os,Jo,ss,...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(ps(i,n));break;case i.startsWith("{^"):o.append(ls(i));break;case i.startsWith("[[["):o.append(ds(i));break;case i.startsWith("[["):o.append(...hs(i,n,e));break;case i.startsWith("|"):o.append(ms(i));break;case i.startsWith("[="):o.append(gs(i));break;case i.startsWith("`"):o.append(bs(i));break;case i.startsWith("[^"):o.append(as(i));break;case t.has(i):o.append(fs(i,n,t));break;case s.test(i):o.append(cs(i))}else o.append(i);n.replaceWith(o)}},setInlineContent:ws});const ks="aom/conformance",xs=Ft({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)=>$t`<p>
334
+ >${s}</a
335
+ >`}function gi(e){const t=e.slice(1,-1);return At`<code>${t}</code>`}function bi(e){return Qo.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?gi(e):bi(e)):document.createTextNode(e)}function yi(e,t){e.textContent="";const n=bi(t);e.append(...Array.isArray(n)?n:[n])}var wi=Object.freeze({__proto__:null,name:Zo,rfc2119Usage:Yo,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new rn,e.informativeReferences=new rn,e.respecRFC2119||(e.respecRFC2119=Yo);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=Gt(e),o=Gt(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].map(e=>It(e)).join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,{acceptNode: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","script","style"],{wsNodes:!1}),i=Xo.rfc2119Keywords(),s=new RegExp(`(${Ko([i,Jo,ii,ei,ti,ni,ri,Qo,oi,...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(di(s,n));break;case s.startsWith("{^"):o.append(ai(s));break;case s.startsWith("[[["):o.append(ui(s));break;case s.startsWith("[["):o.append(...pi(s,n,e));break;case s.startsWith("|"):o.append(fi(s));break;case s.startsWith("[="):o.append(mi(s));break;case s.startsWith("`"):o.append(gi(s));break;case s.startsWith("[^"):o.append(si(s));break;case t.has(s):o.append(hi(s,n,t));break;case i.test(s):o.append(li(s))}else o.append(s);n.replaceWith(o)}},setInlineContent:yi});const vi="aom/conformance",ki=Vt({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)=>At`<p>
336
336
  The key word${t?"s":""} ${e} in this document
337
337
  ${t?"are":"is"} to be interpreted as described in
338
338
  <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a>
339
- ${Wo("RFC2119")} ${Wo("RFC8174")}
339
+ ${Uo("RFC2119")} ${Uo("RFC8174")}
340
340
  when, and only when, ${t?"they appear":"it appears"} in all
341
341
  capitals, as shown here.
342
- </p>`}});function $s(e,t){const n=[...Object.keys(Ko)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(zt(o,(e=>$t`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?$t`${e}`:e)));var o;const s=n.length>1,i=$t`
343
- <h1>${xs.conformance}</h1>
344
- <p>${xs.normativity}</p>
345
- ${n.length?xs.keywordInterpretation(r,s):null}
346
- `;e.prepend(...i.childNodes)}var Es=Object.freeze({__proto__:null,name:ks,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&$s(t,e),!t&&Object.keys(Ko).length){an("Document uses RFC2119 keywords but lacks a conformance section.",ks,{hint:'Please add a `<section id="conformance">`.'})}}});function Ss(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){sn(`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 _s(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 Cs=new rn;function Ls(e,t){for(const n of t)Cs.has(n)||Cs.set(n,new Set),Cs.get(n)?.add(e)}const As="core/dfn",Ts=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:_s}],["element",{requiresFor:!1,validator:Ss}],["element-attr",{requiresFor:!1,validator:Ss}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:_s}],["event",{requiresFor:!1,validator:_s}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new _t(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return sn(`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:_s}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?_s(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)}}]]),Rs=[...Ts.keys()];function Ns(e,t){let n="";switch(!0){case Rs.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Ts.has(e)))??"",function(e,t,n){const r=Ts.get(t);if(r?.requiresFor&&!n.dataset.dfnFor){const e=dn`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=dn`Use a ${"[data-dfn-for]"} attribute to associate this with ${o??""}.`;sn(e,As,{hint:s,elements:[n]})}r?.validator&&r.validator(e,t,n,As)}(t,n,e);break;case uo.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=dn`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.`,As,{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=dn`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${un(o,{quotes:!0})}. The slot "${e}" seems to be a "${cn(r)}"?`;return sn(n,As,{hint:s,elements:[t]}),"dfn"}return s}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType??""}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function Os(e){switch(!0){case e.matches(".export.no-export"):sn(dn`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,As,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){sn(dn`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,As,{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="";break;case function(e){return!e.matches(".export, [data-export]")&&e.closest("section.informative, section.normative")?.classList.contains("informative")}(e):e.dataset.noexport=""}}var Ps=Object.freeze({__proto__:null,name:As,run:function(){for(const e of document.querySelectorAll("dfn")){if(e.closest("del"))continue;const t=Zt(e);if(Ls(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Ns(e,n),Os(e);const r=(e.dataset.localLt||"").split("|").map(Bt),o=t.filter((e=>!r.includes(e)));(o.length>1||n!==Bt(e.textContent))&&(e.dataset.lt=o.join("|"))}}});var Is=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=Bt(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set,n=document.querySelectorAll("dfn:not([data-lt-noDefault])");return n.forEach((e=>{const n=Bt(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=Bt(n).toLowerCase(),o=Ct.isSingular(r)?Ct.plural(r):Ct.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("|"),Ls(e,n)}}))}});var js=String.raw`span.example-title{text-transform:none}
342
+ </p>`}});function xi(e,t){const n=[...Object.keys(Yo)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(Bt(o,e=>At`<em class="rfc2119">${e}</em>`)).map(e=>"string"==typeof e?At`${e}`:e));var o;const i=n.length>1,s=At`
343
+ <h1>${ki.conformance}</h1>
344
+ <p>${ki.normativity}</p>
345
+ ${n.length?ki.keywordInterpretation(r,i):null}
346
+ `;e.prepend(...s.childNodes)}var $i=Object.freeze({__proto__:null,name:vi,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&xi(t,e),!t&&Object.keys(Yo).length){dn("Document uses RFC2119 keywords but lacks a conformance section.",vi,{hint:'Please add a `<section id="conformance">`.'})}}});function Ei(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){un(`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 Si(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return un(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const _i=new ln;function Ci(e,t){for(const n of t)_i.has(n)||_i.set(n,new Set),_i.get(n)?.add(e)}const Ai="core/dfn",Li=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Si}],["element",{requiresFor:!1,validator:Ei}],["element-attr",{requiresFor:!1,validator:Ei}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Si}],["event",{requiresFor:!1,validator:Si}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new Tt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return un(`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:Si}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Si(e.slice(1,-1),t,n,r):(un(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Ri=[...Li.keys()];function Ti(e,t){let n="";switch(!0){case Ri.some(t=>e.classList.contains(t)):n=[...e.classList].find(e=>Li.has(e))??"",function(e,t,n){const r=Li.get(t);if(r?.requiresFor&&!n.dataset.dfnFor){const e=mn`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=mn`Use a ${"[data-dfn-for]"} attribute to associate this with ${o??""}.`;un(e,Ai,{hint:i,elements:[n]})}r?.validator&&r.validator(e,t,n,Ai)}(t,n,e);break;case uo.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=mn`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;un(`Internal slot "${e}" must be associated with a WebIDL interface.`,Ai,{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=mn`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${fn(o,{quotes:!0})}. The slot "${e}" seems to be a "${hn(r)}"?`;return un(n,Ai,{hint:i,elements:[t]}),"dfn"}return i}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType??""}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function Pi(e){switch(!0){case e.matches(".export.no-export"):un(mn`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Ai,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){un(mn`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Ai,{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="";break;case function(e){return!e.matches(".export, [data-export]")&&e.closest("section.informative, section.normative")?.classList.contains("informative")}(e):e.dataset.noexport=""}}var Oi=Object.freeze({__proto__:null,name:Ai,run:function(){for(const e of document.querySelectorAll("dfn")){if(e.closest("del"))continue;const t=Qt(e);if(Ci(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Ti(e,n),Pi(e);const r=(e.dataset.localLt||"").split("|").map(Gt),o=t.filter(e=>!r.includes(e));(o.length>1||n!==Gt(e.textContent))&&(e.dataset.lt=o.join("|"))}}});var Ni=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=Gt(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)});const t=new Set,n=document.querySelectorAll("dfn:not([data-lt-noDefault])");return n.forEach(e=>{const n=Gt(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=Gt(n).toLowerCase(),o=Pt.isSingular(r)?Pt.plural(r):Pt.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("|"),Ci(e,n)}})}});var Ii=String.raw`span.example-title{text-transform:none}
347
347
  :is(aside,div).example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both}
348
348
  div.illegal-example{color:red}
349
349
  div.illegal-example p{color:#000}
350
- aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const Ds=Ft({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},fr:{example:"Exemple"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"},cs:{example:"Příklad"}});function zs(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?$t`<span class="example-title">: ${n.title}</span>`:"";return $t`<div class="marker">
351
- <a class="self-link">${Ds.example}<bdi>${r}</bdi></a
350
+ aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const ji=Vt({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},fr:{example:"Exemple"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"},cs:{example:"Příklad"}});function Di(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?At`<span class="example-title">: ${n.title}</span>`:"";return At`<div class="marker">
351
+ <a class="self-link">${ji.example}<bdi>${r}</bdi></a
352
352
  >${o}
353
- </div>`}var Ms=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;jn(js,{before:document.querySelector("link")});let t=0;e.forEach((e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const o=zs(e,t,n);e.prepend(o);const s=Vt(e,"example",r||String(t));o.querySelector("a.self-link").href=`#${s}`}else{const o=!!e.closest("aside");o||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const i=zs(e,o?0:t,n),a=$t`<div class="example" id="${s}">
354
- ${i} ${e.cloneNode(!0)}
355
- </div>`;Vt(a,"example",r||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var qs=String.raw`.issue-label{text-transform:initial}
353
+ </div>`}var zi=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;zn(Ii,{before:document.querySelector("link")});let t=0;e.forEach(e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const o=Di(e,t,n);e.prepend(o);const i=Xt(e,"example",r||String(t));o.querySelector("a.self-link").href=`#${i}`}else{const o=!!e.closest("aside");o||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const i=e.id?e.id:null;i&&e.removeAttribute("id");const s=Di(e,o?0:t,n),a=At`<div class="example" id="${i}">
354
+ ${s} ${e.cloneNode(!0)}
355
+ </div>`;Xt(a,"example",r||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}})}});var Mi=String.raw`.issue-label{text-transform:initial}
356
356
  .warning>p:first-child{margin-top:0}
357
357
  .warning{padding:.5em;border-left-width:.5em;border-left-style:solid}
358
358
  span.warning{padding:.1em .5em .15em}
@@ -362,37 +362,37 @@ span.warning{padding:.1em .5em .15em}
362
362
  .warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em}
363
363
  li.task-list-item{list-style:none}
364
364
  input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle}
365
- .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 Hs="core/issues-notes",Bs=Ft({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:"警告"},cs:{editors_note:"Poznámka editora",feature_at_risk:"(Funkce v ohrožení) Problém",issue:"Problém",issue_summary:"Souhrn problémů",no_issues_in_spec:"V této specifikaci nejsou uvedeny žádné problémy.",note:"Poznámka",warning:"Varování"},fr:{editors_note:"Note de l'éditeur",issue:"Problème",issue_summary:"Résumé des problèmes",no_issues_in_spec:"Il n'y a aucun problème répertorié dans cette spécification.",note:"Note",warning:"Avertissement"}});function Fs(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?Bs.feature_at_risk:Bs.issue:n?Bs.warning:r?Bs.editors_note:Bs.note;return{type:s,displayType:i,isFeatureAtRisk:o}}(e),l="issue"===s,c="span"===e.localName,{number:u}=e.dataset,d={title:e.title,number:r(e)};if(!c){const r=$t`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,c=document.createElement("span"),p=$t`<div class="${`${s}-title marker`}">${c}</div>`;Vt(p,"h",s);let h,f=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):Vt(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 $t`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return $t`<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){an(`Failed to fetch issue number ${u}.`,Hs)}h&&!d.title&&(d.title=h.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?$t`<span style="text-transform: none">: ${t.title}</span>`:"";return $t`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Bs.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=/^[0-9a-f]{6}$/i.test(n)?n:"f6f8fa",s=new URL("./issues/",t);s.searchParams.set("q",`is:issue is:open label:"${r}"`);const i=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)),a=.2126*o+.7152*s+.0722*i;return a>.179?"#000":"#fff"}(o),a=`background-color: #${o}; color: ${i}`,l=`GitHub label: ${r}`;return $t` <a
365
+ .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 qi="core/issues-notes",Hi=Vt({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:"警告"},cs:{editors_note:"Poznámka editora",feature_at_risk:"(Funkce v ohrožení) Problém",issue:"Problém",issue_summary:"Souhrn problémů",no_issues_in_spec:"V této specifikaci nejsou uvedeny žádné problémy.",note:"Poznámka",warning:"Varování"},fr:{editors_note:"Note de l'éditeur",issue:"Problème",issue_summary:"Résumé des problèmes",no_issues_in_spec:"Il n'y a aucun problème répertorié dans cette spécification.",note:"Note",warning:"Avertissement"}});function Bi(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?Hi.feature_at_risk:Hi.issue:n?Hi.warning:r?Hi.editors_note:Hi.note;return{type:i,displayType:s,isFeatureAtRisk:o}}(e),l="issue"===i,c="span"===e.localName,{number:u}=e.dataset,d={title:e.title,number:r(e)};if(!c){const r=At`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=At`<div class="${`${i}-title marker`}">${c}</div>`;Xt(p,"h",i);let h,f=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):Xt(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 At`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return At`<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){dn(`Failed to fetch issue number ${u}.`,qi)}h&&!d.title&&(d.title=h.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?At`<span style="text-transform: none">: ${t.title}</span>`:"";return At`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Hi.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=/^[0-9a-f]{6}$/i.test(n)?n:"f6f8fa",i=new URL("./issues/",t);i.searchParams.set("q",`is:issue is:open label:"${r}"`);const s=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),a=.2126*o+.7152*i+.0722*s;return a>.179?"#000":"#fff"}(o),a=`background-color: #${o}; color: ${s}`,l=`GitHub label: ${r}`;return At` <a
366
366
  class="respec-gh-label"
367
367
  style="${a}"
368
- href="${s.href}"
368
+ href="${i.href}"
369
369
  aria-label="${l}"
370
370
  >${r}</a
371
- >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return $t`<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"),h&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(h.bodyHTML)),r.append(p,m)}})),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($t`<p>${Bs.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.prepend($t`<h1>${Bs.issue_summary}</h1>`)}(o)}var Us=Object.freeze({__proto__:null,name:Hs,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}).`,Hs),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github??null);jn(qs,{before:document.head.querySelector("link")}),Fs(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Ws="core/best-practices",Gs={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Vs=Ft(Gs),Zs=r in Gs?r:"en";var Ys=Object.freeze({__proto__:null,name:Ws,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=Vt(e,"bp"),o=$t`<a class="marker self-link" href="${`#${r}`}"
372
- ><bdi lang="${Zs}">${Vs.best_practice}${t+1}</bdi></a
373
- >`;if(n){const t=$t`<li>${o}: ${en(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=$t`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild($t`<h1>Best Practices Summary</h1>`),n&&t.appendChild(n));else if(t){an("Using best practices summary (#bp-summary) but no best practices found.",Ws),t.remove()}}});const Ks="core/figures",Qs=Ft({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"},fr:{list_of_figures:"Liste des figures",fig:"Figure "},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var Xs=Object.freeze({__proto__:null,name:Ks,run:function(){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;Vt(e,"fig",r),Qt(t,$t`<span class="fig-title"></span>`),t.prepend($t`<a class="self-link" href="#${e.id}"
374
- >${Qs.fig}<bdi class="figno">${n+1}</bdi></a
375
- >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Yt(e,"span").removeAttribute("href")})),$t`<li class="tofline">
371
+ >`}(e,n));r.length&&r.unshift(document.createTextNode(" "));return At`<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)}}),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(At`<p>${Hi.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.prepend(At`<h1>${Hi.issue_summary}</h1>`)}(o)}var Fi=Object.freeze({__proto__:null,name:qi,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 un(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,qi),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github??null);zn(Mi,{before:document.head.querySelector("link")}),Bi(n,r,e),document.querySelectorAll(".ednote").forEach(e=>{e.classList.remove("ednote"),e.classList.add("note")})}});const Ui="core/best-practices",Wi={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Gi=Vt(Wi),Vi=r in Wi?r:"en";var Zi=Object.freeze({__proto__:null,name:Ui,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=Xt(e,"bp"),o=At`<a class="marker self-link" href="${`#${r}`}"
372
+ ><bdi lang="${Vi}">${Gi.best_practice}${t+1}</bdi></a
373
+ >`;if(n){const t=At`<li>${o}: ${on(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=At`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)}),e.length)t&&(t.appendChild(At`<h1>Best Practices Summary</h1>`),n&&t.appendChild(n));else if(t){dn("Using best practices summary (#bp-summary) but no best practices found.",Ui),t.remove()}}});const Yi="core/figures",Ki=Vt({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"},fr:{list_of_figures:"Liste des figures",fig:"Figure "},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var Xi=Object.freeze({__proto__:null,name:Yi,run:function(){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;Xt(e,"fig",r),tn(t,At`<span class="fig-title"></span>`),t.prepend(At`<a class="self-link" href="#${e.id}"
374
+ >${Ki.fig}<bdi class="figno">${n+1}</bdi></a
375
+ >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach(e=>{Jt(e,"span").removeAttribute("href")}),At`<li class="tofline">
376
376
  <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a>
377
- </li>`}(t.id,r));else{an("Found a `<figure>` without a `<figcaption>`.",Ks,{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($t`<h1>${Qs.list_of_figures}</h1>`,$t`<ul class="tof">
377
+ </li>`}(t.id,r));else{dn("Found a `<figure>` without a `<figcaption>`.",Yi,{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(At`<h1>${Ki.list_of_figures}</h1>`,At`<ul class="tof">
378
378
  ${e}
379
- </ul>`))}});const Js="core/data-cite",ei="__SPEC__";async function ti(e){const{key:t,frag:n,path:r,href:o}=e;let s,i="";if(t===ei)s=document.location.href;else{const e=await Do(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 ni(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,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?Qt(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){sn("Exporting a linked external definition is not allowed.",Js,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function ri(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const oi=ri("#"),si=ri("/");function ii(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^="#"])')??null,{key:o,isNormative:s}=r?ii(r):{key:ei,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=(n??"").replace("#",""),ii(e)}const i=r?`#${r}`:oi(n??""),a=o||si(n??"").split("#")[0],{type:l}=Kt(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 ai(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 li=Object.freeze({__proto__:null,THIS_SPEC:ei,name:Js,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(ii).map((async e=>({entry:e,result:await Do(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await jo(n);r&&Object.assign(To,r)}([...e]);const t=new Map,n=new Map;for(const r of e){t.set(r,r.dataset.cite);const e=ii(r);n.set(r,e)}for(const r of e){const e=t.get(r),o=n.get(r),s=await ti(o);if(s)r.dataset.citeFrag&&r.dataset.matchedText||!r.dataset.lt||"the-empty-string"===r.dataset.lt||""!==r.textContent||(ws(r,r.dataset.lt),delete r.dataset.lt),ni(r,s,o);else{const t=`Couldn't find a match for "${e}"`;r.dataset.matchedText&&(r.textContent=r.dataset.matchedText),an(t,Js,{elements:[r]})}}mn("beforesave",ai)},toCiteDetails:ii});const ci="core/link-to-dfn",ui=[],di={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:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},pi=Ft(di);function hi(e){const t=new Map,n=[];for(const r of Cs.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),Vt(r,"dfn",e)}}return{result:t,duplicates:n}}function fi(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor??"":"",r=Zt(e).reduce(((e,r)=>{const o=r.split(".");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});const s=r.replace(Lt,"");return s!==r&&""!==s&&(e.push({for:n,title:s}),t||e.push({for:s,title:s}),""!==n&&e.push({for:"",title:s})),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:s}=e.dataset;if(s){for(const e of s.split("|"))if(o?.get(e))return o.get(e);return o?.get("dfn")}{const e=r.for?"idl":"dfn";return o?.get(e)||o?.get("idl")}}function mi(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=gi(e)&&gi(t,n);r&&!o||Qt(e,document.createElement("code"))}(e,t),!r}function gi(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 bi(e){e.forEach((e=>{const t=`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,n=e.closest("[data-link-for]"),r=`Add a matching \`<dfn>\` element, ${dn`use ${"[data-cite]"} to link to an external definition, or enable ${"[xref]"} for automatic cross-spec linking.`}${n?` This link is inside a \`data-link-for="${n.dataset.linkFor}"\` section — \`[=term=]\` links are scoped to that context. To link to a global concept instead, either add \`data-link-for=""\` on this \`<a>\` or move it outside the scoped section.`:""}`;an(t,ci,{title:"Linking error: no matching `<dfn>`",hint:r,elements:[e]})}))}var yi=Object.freeze({__proto__:null,name:ci,possibleExternalLinks:ui,run:async function(e){const t=function(){const e=new rn;for(const t of Cs.keys()){const{result:n,duplicates:r}=hi(t);e.set(t,n),r.length>0&&sn(pi.duplicateMsg(t),ci,{title:pi.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite='']:not([data-no-link-to-dfn]), a:not([href]):not([data-cite]):not([data-no-link-to-dfn]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){ui.push(e);continue}const r=fi(e,t);if(r){mi(e,r,t)||ui.push(e)}else""===e.dataset.cite?n.push(e):ui.push(e)}bi(n),function(e){const{shortName:t=""}=e,n=t?new RegExp(String.raw`^([?!])?${Tt(t)}\b([^-])`,"i"):null,r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){n&&(t.dataset.cite=(t.dataset.cite??"").replace(n,`$1${ei}$2`));const{key:r,isNormative:o}=ii(t);r!==ei&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||bi(ui)}});const wi="headings",vi=864e5;async function ki(){return await Et.openDB("respec-headings",1,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t))),e.createObjectStore(wi)}})}async function xi(e){const t=new Map;if(function(){const e=parseInt(localStorage.getItem("HEADINGS:LAST_CACHED")??"",10);return!isNaN(e)&&Date.now()-e>vi}())return await async function(){try{const e=await ki();await e.clear(wi),localStorage.removeItem("HEADINGS:LAST_CACHED")}catch(e){console.error(e)}}(),t;try{const n=(await ki()).transaction(wi);for(const r of e){const e=`${r.spec}#${r.id}`,o=await n.store.get(e);o&&t.set(e,o.result)}}catch(e){console.error(e)}return t}const $i="core/xref-headings",Ei="https://respec.org/xref/search/headings";async function Si(e,t=Ei){if(!e.length)return new Map;const n=await xi(e),r=e.filter((e=>!n.has(`${e.spec}#${e.id}`)));if(!r.length)return n;try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queries:r})});if(!e.ok){const t=`Failed to fetch heading texts (HTTP ${e.status}).`;return an(t,$i,{hint:"Cross-spec section links will fall back to spec titles."}),n}const{result:o=[]}=await e.json(),s=new Map(o.filter((e=>!e.error)).map((e=>[`${e.spec}#${e.id}`,{title:e.title,number:e.number||null}])));return await async function(e,t){try{const n=(await ki()).transaction(wi,"readwrite");for(const r of e){const e=`${r.spec}#${r.id}`,o=t.get(e);o&&n.objectStore(wi).put({query:r,result:o},e)}await n.done,localStorage.setItem("HEADINGS:LAST_CACHED",Date.now().toString())}catch(e){console.error(e)}}(r,s),new Map([...n,...s])}catch{return an("Failed to fetch heading texts from respec.org.",$i,{hint:"Cross-spec section links will fall back to spec titles."}),n}}function _i(e,{title:t,number:n}){e.classList.add("sec-ref"),e.textContent="",e.append("§ "),n?e.append($t`<bdi class="secno">${n} </bdi>`,t):e.append(t)}var Ci=Object.freeze({__proto__:null,HEADINGS_API_URL:Ei,fetchHeadingTexts:Si,name:$i,run:async function(e){const t=document.querySelectorAll("a[data-cite-frag][data-matched-text]");if(!t.length)return;const n=function(e){const t="object"!=typeof e.xref||null===e.xref||Array.isArray(e.xref)?{}:e.xref;return"string"==typeof t.headingApiUrl?t.headingApiUrl:Ei}(e),r=new Map,o=[];if(t.forEach((e=>{if(e.dataset.lt)ws(e,e.dataset.lt),delete e.dataset.lt;else{const t=(e.dataset.cite??"").replace(/^[!?]/,""),n=e.dataset.citeFrag??"",s=`${t}#${n}`;o.push({elem:e,key:s}),r.has(s)||r.set(s,{spec:t,id:n})}})),!o.length)return;const s=await Si([...r.values()],n);o.forEach((({elem:e,key:t})=>{const n=s.get(t);n?.title&&_i(e,n)}))},setHeadingContent:_i});const Li="core/contrib";var Ai=Object.freeze({__proto__:null,name:Li,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void sn(dn`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Li)}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 $t(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 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 sn("Error loading contributors from GitHub.",Li,{cause:e}),null}}}(t,n)}});var Ti=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=>null!==e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e&&e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Yt(e,`h${t}`)}))}});const Ri=["h2","h3","h4","h5","h6"],Ni="core/structure",Oi=Ft({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},fr:{toc:"Table des matières",back_to_top:"Retourner en haut"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function Pi(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=$t`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?Ii(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($t`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Di(a.header,n),o=Pi(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function Ii(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function ji(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(!Ri.includes(r.localName))continue;const o=r.textContent;Vt(e,void 0,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:ji(e)})}return n}function Di(e,t){const n=$t`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Yt(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Yt(e,"span").removeAttribute("id")})),$t`<li class="tocline">${n}</li>`}var zi=Object.freeze({__proto__:null,name:Ni,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=Math.min(function(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}(e,"section").length+1,6),n=`h${t}`;e.localName!==n&&Yt(e,n)}))}(),!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).",Ni,{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=Pi(ji(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=$t`<nav id="toc"></nav>`,n=$t`<h2 class="introductory">${Oi.toc}</h2>`;Vt(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=$t`<p role="navigation" id="back-to-top">
380
- <a href="#title"><abbr title="${Oi.back_to_top}">&uarr;</abbr></a>
381
- </p>`;document.body.append(o)}(t)}fn("toc",void 0)}});const Mi=Ft({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:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."},fr:{informative:"Cette section est non normative."}});var qi=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=>null!==e)).forEach((e=>{e.after($t`<p><em>${Mi.informative}</em></p>`)}))}});const Hi=Ft({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Bt(t.textContent)}`),n}}});var Bi=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||(Vt(n),t=n.parentElement?.id||n.id),!e.addSectionLinks)continue;const r=Hi.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=$t`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=$t`<a
379
+ </ul>`))}});const Qi="core/data-cite",Ji="__SPEC__";async function es(e){const{key:t,frag:n,path:r,href:o}=e;let i,s="";if(t===Ji)i=document.location.href;else{const e=await jo(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 ts(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,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?tn(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){un("Exporting a linked external definition is not allowed.",Qi,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function ns(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const rs=ns("#"),os=ns("/");function is(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^="#"])')??null,{key:o,isNormative:i}=r?is(r):{key:Ji,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=(n??"").replace("#",""),is(e)}const s=r?`#${r}`:rs(n??""),a=o||os(n??"").split("#")[0],{type:l}=en(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 ss(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 as=Object.freeze({__proto__:null,THIS_SPEC:Ji,name:Qi,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(is).map(async e=>({entry:e,result:await jo(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await Io(n);r&&Object.assign(Ro,r)}([...e]);const t=new Map,n=new Map;for(const r of e){t.set(r,r.dataset.cite);const e=is(r);n.set(r,e)}for(const r of e){const e=t.get(r),o=n.get(r),i=await es(o);if(i)r.dataset.citeFrag&&r.dataset.matchedText||!r.dataset.lt||"the-empty-string"===r.dataset.lt||""!==r.textContent||(yi(r,r.dataset.lt),delete r.dataset.lt),ts(r,i,o);else{const t=`Couldn't find a match for "${e}"`;r.dataset.matchedText&&(r.textContent=r.dataset.matchedText),dn(t,Qi,{elements:[r]})}}wn("beforesave",ss)},toCiteDetails:is});const ls="core/link-to-dfn",cs=[],us={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:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},ds=Vt(us);function ps(e){const t=new Map,n=[];for(const r of _i.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),Xt(r,"dfn",e)}}return{result:t,duplicates:n}}function hs(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor??"":"",r=Qt(e).reduce((e,r)=>{const o=r.split(".");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});const i=r.replace(Ot,"");return i!==r&&""!==i&&(e.push({for:n,title:i}),t||e.push({for:i,title:i}),""!==n&&e.push({for:"",title:i})),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){for(const e of i.split("|"))if(o?.get(e))return o.get(e);return o?.get("dfn")}{const e=r.for?"idl":"dfn";return o?.get(e)||o?.get("idl")}}function fs(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=ms(e)&&ms(t,n);r&&!o||tn(e,document.createElement("code"))}(e,t),!r}function ms(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 gs(e){e.forEach(e=>{const t=`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,n=e.closest("[data-link-for]"),r=`Add a matching \`<dfn>\` element, ${mn`use ${"[data-cite]"} to link to an external definition, or enable ${"[xref]"} for automatic cross-spec linking.`}${n?` This link is inside a \`data-link-for="${n.dataset.linkFor}"\` section — \`[=term=]\` links are scoped to that context. To link to a global concept instead, either add \`data-link-for=""\` on this \`<a>\` or move it outside the scoped section.`:""}`;dn(t,ls,{title:"Linking error: no matching `<dfn>`",hint:r,elements:[e]})})}var bs=Object.freeze({__proto__:null,name:ls,possibleExternalLinks:cs,run:async function(e){const t=function(){const e=new ln;for(const t of _i.keys()){const{result:n,duplicates:r}=ps(t);e.set(t,n),r.length>0&&un(ds.duplicateMsg(t),ls,{title:ds.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite='']:not([data-no-link-to-dfn]), a:not([href]):not([data-cite]):not([data-no-link-to-dfn]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){cs.push(e);continue}const r=hs(e,t);if(r){fs(e,r,t)||cs.push(e)}else""===e.dataset.cite?n.push(e):cs.push(e)}gs(n),function(e){const{shortName:t=""}=e,n=t?new RegExp(String.raw`^([?!])?${It(t)}\b([^-])`,"i"):null,r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){n&&(t.dataset.cite=(t.dataset.cite??"").replace(n,`$1${Ji}$2`));const{key:r,isNormative:o}=is(t);r!==Ji&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||gs(cs)}});const ys="headings",ws=864e5;async function vs(){return await Lt.openDB("respec-headings",1,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t)),e.createObjectStore(ys)}})}async function ks(e){const t=new Map;if(function(){const e=parseInt(localStorage.getItem("HEADINGS:LAST_CACHED")??"",10);return!isNaN(e)&&Date.now()-e>ws}())return await async function(){try{const e=await vs();await e.clear(ys),localStorage.removeItem("HEADINGS:LAST_CACHED")}catch(e){console.error(e)}}(),t;try{const n=(await vs()).transaction(ys);for(const r of e){const e=`${r.spec}#${r.id}`,o=await n.store.get(e);o&&t.set(e,o.result)}}catch(e){console.error(e)}return t}const xs="core/xref-headings",$s="https://respec.org/xref/search/headings";async function Es(e,t=$s){if(!e.length)return new Map;const n=await ks(e),r=e.filter(e=>!n.has(`${e.spec}#${e.id}`));if(!r.length)return n;try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queries:r})});if(!e.ok){const t=`Failed to fetch heading texts (HTTP ${e.status}).`;return dn(t,xs,{hint:"Cross-spec section links will fall back to spec titles."}),n}const{result:o=[]}=await e.json(),i=new Map(o.filter(e=>!e.error).map(e=>[`${e.spec}#${e.id}`,{title:e.title,number:e.number||null}]));return await async function(e,t){try{const n=(await vs()).transaction(ys,"readwrite");for(const r of e){const e=`${r.spec}#${r.id}`,o=t.get(e);o&&n.objectStore(ys).put({query:r,result:o},e)}await n.done,localStorage.setItem("HEADINGS:LAST_CACHED",Date.now().toString())}catch(e){console.error(e)}}(r,i),new Map([...n,...i])}catch{return dn("Failed to fetch heading texts from respec.org.",xs,{hint:"Cross-spec section links will fall back to spec titles."}),n}}function Ss(e,{title:t,number:n}){e.classList.add("sec-ref"),e.textContent="",e.append("§ "),n?e.append(At`<bdi class="secno">${n} </bdi>`,t):e.append(t)}var _s=Object.freeze({__proto__:null,HEADINGS_API_URL:$s,fetchHeadingTexts:Es,name:xs,run:async function(e){const t=document.querySelectorAll("a[data-cite-frag][data-matched-text]");if(!t.length)return;const n=function(e){const t="object"!=typeof e.xref||null===e.xref||Array.isArray(e.xref)?{}:e.xref;return"string"==typeof t.headingApiUrl?t.headingApiUrl:$s}(e),r=new Map,o=[];if(t.forEach(e=>{if(e.dataset.lt)yi(e,e.dataset.lt),delete e.dataset.lt;else{const t=(e.dataset.cite??"").replace(/^[!?]/,""),n=e.dataset.citeFrag??"",i=`${t}#${n}`;o.push({elem:e,key:i}),r.has(i)||r.set(i,{spec:t,id:n})}}),!o.length)return;const i=await Es([...r.values()],n);o.forEach(({elem:e,key:t})=>{const n=i.get(t);n?.title&&Ss(e,n)})},setHeadingContent:Ss});const Cs="core/contrib";var As=Object.freeze({__proto__:null,name:Cs,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void un(mn`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Cs)}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 At(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=Ut(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 un("Error loading contributors from GitHub.",Cs,{cause:e}),null}}}(t,n)}});var Ls=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=>null!==e).forEach(e=>{const t=Math.min(function(e,t){const n=[];for(;e&&e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Jt(e,`h${t}`)})}});const Rs=["h2","h3","h4","h5","h6"],Ts="core/structure",Ps=Vt({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},fr:{toc:"Table des matières",back_to_top:"Retourner en haut"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function Os(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=At`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=i,r=!0);let e=a.isIntro?"":r?Ns(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(At`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=js(a.header,n),o=Os(a.subsections,t,{prefix:e});o&&r.append(o),s.append(r)}}return s}function Ns(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Is(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(!Rs.includes(r.localName))continue;const o=r.textContent;Xt(e,void 0,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Is(e)})}return n}function js(e,t){const n=At`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=Jt(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{Jt(e,"span").removeAttribute("id")}),At`<li class="tocline">${n}</li>`}var Ds=Object.freeze({__proto__:null,name:Ts,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=Math.min(function(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}(e,"section").length+1,6),n=`h${t}`;e.localName!==n&&Jt(e,n)})}(),!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)){un("`data-max-toc` must have a value between 0-6 (inclusive).",Ts,{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=Os(Is(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=At`<nav id="toc"></nav>`,n=At`<h2 class="introductory">${Ps.toc}</h2>`;Xt(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=At`<p role="navigation" id="back-to-top">
380
+ <a href="#title"><abbr title="${Ps.back_to_top}">&uarr;</abbr></a>
381
+ </p>`;document.body.append(o)}(t)}yn("toc",void 0)}});const zs=Vt({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:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."},fr:{informative:"Cette section est non normative."}});var Ms=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=>null!==e).forEach(e=>{e.after(At`<p><em>${zs.informative}</em></p>`)})}});const qs=Vt({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Gt(t.textContent)}`),n}}});var Hs=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||(Xt(n),t=n.parentElement?.id||n.id),!e.addSectionLinks)continue;const r=qs.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=At`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=At`<a
382
382
  href="#${t}"
383
383
  class="self-link"
384
384
  aria-label="${r}"
385
- ></a>`;o.append(n,s)}}});const Fi="ui/save-html",Ui=Ft({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Wi=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return yn(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return yn(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 Gi(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return Rt.format(e).replace(At,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return $t`<a
385
+ ></a>`;o.append(n,i)}}});const Bs="ui/save-html",Fs=Vt({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Us=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return xn(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return xn(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 Ws(e,t){const{id:n,href:r,ext:o,title:i,type:s}=e,a=function(e,t=""){return jt.format(e).replace(Nt,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return At`<a
386
386
  href="${r}"
387
387
  id="${n}"
388
388
  download="${l}.${o}"
389
- type="${i}"
389
+ type="${s}"
390
390
  class="respec-save-button"
391
- onclick=${()=>ir.closeModal()}
392
- >${s}</a
393
- >`}var Vi=Object.freeze({__proto__:null,exportDocument:function(e,t){return an("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Fi,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),yn(t)},name:Fi,run:function(e){const t={async show(t){await document.respec.ready;const n=$t`<div class="respec-save-buttons">
394
- ${Wi.map((t=>Gi(t,e)))}
395
- </div>`;ir.freshModal(Ui.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=ir.addCommand(Ui.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Zi=Ft({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"},cs:{about_respec:"O aplikaci"}});window.respecVersion=window.respecVersion||"Developer Edition";const Yi=document.createElement("div"),Ki=$t.bind(Yi),Qi=ir.addCommand(`${Zi.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(Xi).forEach((t=>{e.push(t)}));Ki`
391
+ onclick=${()=>lr.closeModal()}
392
+ >${i}</a
393
+ >`}var Gs=Object.freeze({__proto__:null,exportDocument:function(e,t){return dn("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Bs,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),xn(t)},name:Bs,run:function(e){const t={async show(t){await document.respec.ready;const n=At`<div class="respec-save-buttons">
394
+ ${Us.map(t=>Ws(t,e))}
395
+ </div>`;lr.freshModal(Fs.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=lr.addCommand(Fs.save_snapshot,function(){if(!n)return;t.show(r)},"Ctrl+Shift+Alt+S","💾"))}});const Vs=Vt({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"},cs:{about_respec:"O aplikaci"}});window.respecVersion=window.respecVersion||"Developer Edition";const Zs=document.createElement("div"),Ys=At.bind(Zs),Ks=lr.addCommand(`${Vs.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(Xs).forEach(t=>{e.push(t)});Ys`
396
396
  <p>
397
397
  ReSpec is a document production toolchain, with a notable focus on W3C specifications.
398
398
  </p>
@@ -416,19 +416,19 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle}
416
416
  </thead>
417
417
  <tbody>${e}</tbody>
418
418
  </table>
419
- `,ir.freshModal(`${Zi.about_respec} - ${window.respecVersion}`,Yi,Qi)}),"Ctrl+Shift+Alt+A","ℹ️");function Xi({name:e,duration:t}){return $t`
419
+ `,lr.freshModal(`${Vs.about_respec} - ${window.respecVersion}`,Zs,Ks)},"Ctrl+Shift+Alt+A","ℹ️");function Xs({name:e,duration:t}){return At`
420
420
  <tr>
421
421
  <td><a href="${`https://github.com/speced/respec/blob/develop/src/${e}.js`}">${e}</a></td>
422
422
  <td>${t}</td>
423
423
  </tr>
424
- `}var Ji=Object.freeze({__proto__:null});var ea=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=$t`<meta
424
+ `}var Qs=Object.freeze({__proto__:null});var Js=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=At`<meta
425
425
  name="revision"
426
426
  content="${e.gitRevision}"
427
- />`;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const ta="\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n";var na=String.raw`.hljs,body:has(input[name=color-scheme][value=light]:checked) .hljs,head:not(:has(meta[name=color-scheme][content~=dark]))+body .hljs{--base:#fafafa;--mono-1:#383a42;--mono-2:#686b77;--mono-3:#717277;--hue-1:#0b76c5;--hue-2:#336ae3;--hue-3:#a626a4;--hue-4:#42803c;--hue-5:#ca4706;--hue-5-2:#c91243;--hue-6:#986801;--hue-6-2:#9a6a01}
427
+ />`;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const ea="\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n";var ta=String.raw`.hljs,body:has(input[name=color-scheme][value=light]:checked) .hljs,head:not(:has(meta[name=color-scheme][content~=dark]))+body .hljs{--base:#fafafa;--mono-1:#383a42;--mono-2:#686b77;--mono-3:#717277;--hue-1:#0b76c5;--hue-2:#336ae3;--hue-3:#a626a4;--hue-4:#42803c;--hue-5:#ca4706;--hue-5-2:#c91243;--hue-6:#986801;--hue-6-2:#9a6a01}
428
428
  @media (prefers-color-scheme:dark){
429
- .hljs{${ta}}
429
+ .hljs{${ea}}
430
430
  }
431
- body:has(input[name=color-scheme][value=dark]:checked) .hljs{${ta}}
431
+ body:has(input[name=color-scheme][value=dark]:checked) .hljs{${ea}}
432
432
  .hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;color:var(--mono-1,#383a42);background:#fafafa;background:var(--base,#fafafa)}
433
433
  .hljs-comment,.hljs-quote{color:#717277;color:var(--mono-3,#717277);font-style:italic}
434
434
  .hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4;color:var(--hue-3,#a626a4)}
@@ -440,7 +440,7 @@ body:has(input[name=color-scheme][value=dark]:checked) .hljs{${ta}}
440
440
  .hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3;color:var(--hue-2,#336ae3)}
441
441
  .hljs-emphasis{font-style:italic}
442
442
  .hljs-strong{font-weight:700}
443
- .hljs-link{text-decoration:underline}`;const ra=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function oa(e){const t=e;t.setAttribute("aria-busy","true");const n=(r=t.classList,Array.from(r).filter((e=>"highlight"!==e&&"nolinks"!==e)).map((e=>e.toLowerCase())));var r;let o;try{o=await async function(e,t){const n={action:"highlight",code:e,id:ra(),languages:t},r=await Sn;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}))}))}))}(t.textContent,n)}catch(e){return void console.error(e)}const{language:s,value:i}=o;switch(t.localName){case"pre":t.classList.remove(s),t.innerHTML=`<code class="hljs${s?` ${s}`:""}">${i}</code>`,t.classList.length||t.removeAttribute("class");break;case"code":t.innerHTML=i,t.classList.add("hljs"),s&&t.classList.add(s)}t.setAttribute("aria-busy","false")}var sa=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.cddl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.cddl):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(oa);jn(na),await Promise.all(n)}});const ia="core/list-sorter";function aa(e){const t="ascending"===e?1:-1;return(e,n)=>{const r=e.textContent??"",o=n.textContent??"";return t*r.trim().localeCompare(o.trim())}}function la(e,t){return[...e.querySelectorAll(":scope > li")].sort(aa(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function ca(e,t){return[...e.querySelectorAll(":scope > dt")].sort(aa(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 ua=Object.freeze({__proto__:null,name:ia,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=ca(t,n);break;case"ol":case"ul":e=la(t,n);break;default:an(`ReSpec can't sort ${t.localName} elements.`,ia,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:ca,sortListItems:la});var da=String.raw`var:hover{text-decoration:underline;cursor:pointer}
443
+ .hljs-link{text-decoration:underline}`;const na=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function ra(e){const t=e;t.setAttribute("aria-busy","true");const n=(r=t.classList,Array.from(r).filter(e=>"highlight"!==e&&"nolinks"!==e).map(e=>e.toLowerCase()));var r;let o;try{o=await async function(e,t){const n={action:"highlight",code:e,id:na(),languages:t},r=await Ln;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}))})})}(t.textContent,n)}catch(e){return void console.error(e)}const{language:i,value:s}=o;switch(t.localName){case"pre":t.classList.remove(i),t.innerHTML=`<code class="hljs${i?` ${i}`:""}">${s}</code>`,t.classList.length||t.removeAttribute("class");break;case"code":t.innerHTML=s,t.classList.add("hljs"),i&&t.classList.add(i)}t.setAttribute("aria-busy","false")}var oa=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.cddl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.cddl):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(ra);zn(ta),await Promise.all(n)}});const ia="core/list-sorter";function sa(e){const t="ascending"===e?1:-1;return(e,n)=>{const r=e.textContent??"",o=n.textContent??"";return t*r.trim().localeCompare(o.trim())}}function aa(e,t){return[...e.querySelectorAll(":scope > li")].sort(sa(t)).reduce((e,t)=>(e.appendChild(t),e),document.createDocumentFragment())}function la(e,t){return[...e.querySelectorAll(":scope > dt")].sort(sa(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 ca=Object.freeze({__proto__:null,name:ia,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=la(t,n);break;case"ol":case"ul":e=aa(t,n);break;default:dn(`ReSpec can't sort ${t.localName} elements.`,ia,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:la,sortListItems:aa});var ua=String.raw`var:hover{text-decoration:underline;cursor:pointer}
444
444
  var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)}
445
445
  @media (prefers-color-scheme:dark){
446
446
  var.respec-hl{filter:saturate(.9) brightness(.9)}
@@ -454,11 +454,11 @@ var.respec-hl-c6{--bg-color:#82ddff}
454
454
  var.respec-hl-c7{--bg-color:#ffbcf2}
455
455
  @media print{
456
456
  var.respec-hl{background:0 0;color:#000;box-shadow:unset}
457
- }`;var pa=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;jn(da);const t=document.createElement("script");t.id="respec-highlight-vars",t.textContent=await async function(){try{return(await Promise.resolve().then((function(){return ll}))).default}catch{return vn("./src/core/highlight-vars.runtime.js")}}(),document.body.append(t),mn("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach((e=>{const t=[...e.classList.values()].filter((e=>e.startsWith("respec-hl")));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")}))}))}});var ha=String.raw`var[data-type]{position:relative}
457
+ }`;var da=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;zn(ua);const t=document.createElement("script");t.id="respec-highlight-vars",t.textContent=await async function(){try{return(await Promise.resolve().then(function(){return al})).default}catch{return En("./src/core/highlight-vars.runtime.js")}}(),document.body.append(t),wn("beforesave",e=>{e.querySelectorAll("var.respec-hl").forEach(e=>{const t=[...e.classList.values()].filter(e=>e.startsWith("respec-hl"));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")})})}});var pa=String.raw`var[data-type]{position:relative}
458
458
  var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none}
459
459
  var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#222}
460
460
  var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#222;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}
461
- var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var fa=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;jn(ha);let t=null;const n=new Map,r=document.querySelectorAll("section var");for(const e of r){const r=e.closest("section");if(t!==r&&(t=r,n.clear()),e.dataset.type){n.set(e.textContent.trim(),e.dataset.type);continue}const o=n.get(e.textContent.trim());o&&(e.dataset.type=o)}}});const ma="core/anchor-expander";function ga(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.`,ma,{title:"Missing title.",elements:[n]})}const o=en(r);n.append(...o.childNodes),n.classList.add("box-ref")}function ba(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>\`.`,ma,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...en(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=Bt(s.textContent))}function ya(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>\`.`,ma,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...en(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=Bt(s.textContent))}function wa(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)va(r,n),ka(r,n);else{n.textContent=n.getAttribute("href");sn("Found matching section, but the section was lacking a heading element.",ma,{title:`No matching id in document: "${t}".`,elements:[n]})}}function va(e,t){const n=e.querySelector(".self-link"),r=[...en(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild&&t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=(t.lastChild.textContent??"").trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Yt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function ka(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 xa=Object.freeze({__proto__:null,name:ma,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":va(n,t);break;case"section":wa(n,e,t);break;case"figure":ba(n,e,t);break;case"table":ya(n,e,t);break;case"aside":case"div":ga(n,e,t);break;case"dfn":{const e=en(n);t.append(...e.childNodes),t.classList.add("dfn-ref");break}default:t.textContent=t.getAttribute("href");sn("ReSpec doesn't support expanding this kind of reference.",ma,{title:`Can't expand "#${e}".`,elements:[t]})}ka(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");sn(`Couldn't expand inline reference. The id "${e}" is not in the document.`,ma,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var $a=String.raw`dfn{cursor:pointer}
461
+ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var ha=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;zn(pa);let t=null;const n=new Map,r=document.querySelectorAll("section var");for(const e of r){const r=e.closest("section");if(t!==r&&(t=r,n.clear()),e.dataset.type){n.set(e.textContent.trim(),e.dataset.type);continue}const o=n.get(e.textContent.trim());o&&(e.dataset.type=o)}}});const fa="core/anchor-expander";function ma(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void un(`Found matching element "${t}", but it has no title or marker.`,fa,{title:"Missing title.",elements:[n]})}const o=on(r);n.append(...o.childNodes),n.classList.add("box-ref")}function ga(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void un(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,fa,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...on(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=Gt(i.textContent))}function ba(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void un(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,fa,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...on(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=Gt(i.textContent))}function ya(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(!r){n.textContent=n.getAttribute("href");return void un("Found matching section, but the section was lacking a heading element.",fa,{title:`No matching id in document: "${t}".`,elements:[n]})}wa(r,n),va(r,n)}function wa(e,t){const n=e.querySelector(".self-link"),r=[...on(e).childNodes].filter(e=>!e.classList||!e.classList.contains("self-link"));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild&&t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=(t.lastChild.textContent??"").trimEnd()),t.querySelectorAll("a").forEach(e=>{const t=Jt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)})}function va(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 ka=Object.freeze({__proto__:null,name:fa,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){t.textContent=t.getAttribute("href");un(`Couldn't expand inline reference. The id "${e}" is not in the document.`,fa,{title:`No matching id in document: ${e}.`,elements:[t]});continue}switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":wa(n,t);break;case"section":ya(n,e,t);break;case"figure":ga(n,e,t);break;case"table":ba(n,e,t);break;case"aside":case"div":ma(n,e,t);break;case"dfn":{const e=on(n);t.append(...e.childNodes),t.classList.add("dfn-ref");break}default:t.textContent=t.getAttribute("href");un("ReSpec doesn't support expanding this kind of reference.",fa,{title:`Can't expand "#${e}".`,elements:[t]})}va(n,t),t.normalize()}}});var xa=String.raw`dfn{cursor:pointer}
462
462
  .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;background:var(--indextable-hover-bg,#fff);color:#000;color:var(--text,#000);box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);box-shadow:0 1em 3em -.4em var(--tocsidebar-shadow,rgba(0,0,0,.3)),0 0 1px 1px var(--tocsidebar-shadow,rgba(0,0,0,.05));border-radius:2px}
463
463
  .dfn-panel:not(.docked)>.caret{position:absolute;top:-9px}
464
464
  .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;border-bottom-color:var(--indextable-hover-bg,#fff);top:0}
@@ -476,34 +476,34 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var fa=Obje
476
476
  .dfn-panel a[href]:hover{border-bottom-width:1px}
477
477
  .dfn-panel ul{padding:0}
478
478
  .dfn-panel li{margin-left:1em}
479
- .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 Ea(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")||Bt(e.textContent),i=$t`
479
+ .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 $a(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")||Gt(e.textContent),s=At`
480
480
  <div
481
481
  class="dfn-panel"
482
482
  id="${o}"
483
483
  hidden
484
484
  role="dialog"
485
485
  aria-modal="true"
486
- aria-label="Links in this document to definition: ${s}"
486
+ aria-label="Links in this document to definition: ${i}"
487
487
  >
488
488
  <span class="caret"></span>
489
489
  <div>
490
490
  <a
491
491
  class="self-link"
492
492
  href="${n}"
493
- aria-label="Permalink for definition: ${s}. Activate to close this dialog."
493
+ aria-label="Permalink for definition: ${i}. Activate to close this dialog."
494
494
  >Permalink</a
495
495
  >
496
- ${function(e){return e.matches("dfn[data-export]")?$t`<span
496
+ ${function(e){return e.matches("dfn[data-export]")?At`<span
497
497
  class="marker dfn-exported"
498
498
  title="Definition can be referenced by other specifications"
499
499
  >exported</span
500
- >`: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 $t`<a
500
+ >`: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 At`<a
501
501
  href="${e}"
502
502
  class="marker idl-block"
503
503
  title="Jump to IDL declaration"
504
504
  >IDL</a
505
505
  >`}}return null}(e,r)}
506
- ${function(e,t){const{dfnType:n}=e.dataset;if(!n?.startsWith("cddl-"))return null;const r=[...t].map((e=>e.closest("pre.cddl"))).find((e=>e?.id));return r?$t`<a
506
+ ${function(e,t){const{dfnType:n}=e.dataset;if(!n?.startsWith("cddl-"))return null;const r=[...t].map(e=>e.closest("pre.cddl")).find(e=>e?.id);return r?At`<a
507
507
  href="#${r.id}"
508
508
  class="marker cddl-block"
509
509
  title="Jump to CDDL declaration"
@@ -511,18 +511,18 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var fa=Obje
511
511
  >`:null}(e,r)}
512
512
  </div>
513
513
  <p><b>Referenced in:</b></p>
514
- ${function(e,t){if(!t.length)return $t`<ul>
514
+ ${function(e,t){if(!t.length)return At`<ul>
515
515
  <li>Not referenced in this document.</li>
516
- </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?`§ ${Bt(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=>$t`<li>
517
- ${r(e).map((e=>$t`<a href="#${e.id}" title="${e.title}">${e.text}</a
518
- >${" "}`))}
519
- </li>`;return $t`<ul>
516
+ </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?`§ ${Gt(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=>At`<li>
517
+ ${r(e).map(e=>At`<a href="#${e.id}" title="${e.title}">${e.text}</a
518
+ >${" "}`)}
519
+ </li>`;return At`<ul>
520
520
  ${[...n].map(o)}
521
521
  </ul>`}(t,r)}
522
522
  </div>
523
- `;return i}var Sa=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){jn($a,{before: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(Ea(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");const n=document.body.querySelector("script");n?n.before(t):document.body.append(t);const r=document.createElement("script");r.id="respec-dfn-panel",r.textContent=await async function(){try{return(await Promise.resolve().then((function(){return cl}))).default}catch{return vn("./src/core/dfn-panel.runtime.js")}}(),document.body.append(r)}});const _a=new Promise(((e,t)=>{}));Ft({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 Ca="rs-changelog",La=class extends HTMLElement{constructor(){super();const e=this.getAttribute("filter"),t=e&&"function"==typeof window[e]?window[e]:()=>!0;this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",repo:this.getAttribute("repo"),path:this.getAttribute("path"),filter:t}}connectedCallback(){const{from:e,to:t,filter:n,repo:r,path:o}=this.props;$t.bind(this)`
523
+ `;return s}var Ea=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){zn(xa,{before: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($a(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");const n=document.body.querySelector("script");n?n.before(t):document.body.append(t);const r=document.createElement("script");r.id="respec-dfn-panel",r.textContent=await async function(){try{return(await Promise.resolve().then(function(){return ll})).default}catch{return En("./src/core/dfn-panel.runtime.js")}}(),document.body.append(r)}});const Sa=new Promise((e,t)=>{});Vt({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 _a="rs-changelog",Ca=class extends HTMLElement{constructor(){super();const e=this.getAttribute("filter"),t=e&&"function"==typeof window[e]?window[e]:()=>!0;this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",repo:this.getAttribute("repo"),path:this.getAttribute("path"),filter:t}}connectedCallback(){const{from:e,to:t,filter:n,repo:r,path:o}=this.props;At.bind(this)`
524
524
  <ul>
525
- ${{any:Aa(e,t,n,r,o).then((e=>async function(e,t){const n=await _a,r=t?`https://github.com/${t}/`:n?.repoURL;return e.map((e=>{const[t,n=null]=e.message.split(/\(#(\d+)\)/,2),o=`${r}commit/${e.hash}`,s=n&&$t` (<a href="${n?`${r}pull/${n}`:null}">#${n}</a>)`;return $t`<li><a href="${o}">${t.trim()}</a>${s}</li>`}))}(e,r))).catch((e=>sn(e.message,Ca,{elements:[this],cause:e}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}}
525
+ ${{any:Aa(e,t,n,r,o).then(e=>async function(e,t){const n=await Sa,r=t?`https://github.com/${t}/`:n?.repoURL;return e.map(e=>{const[t,n=null]=e.message.split(/\(#(\d+)\)/,2),o=`${r}commit/${e.hash}`,i=n&&At` (<a href="${n?`${r}pull/${n}`:null}">#${n}</a>)`;return At`<li><a href="${o}">${t.trim()}</a>${i}</li>`})}(e,r)).catch(e=>un(e.message,_a,{elements:[this],cause:e})).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}}
526
526
  </ul>
527
- `}};async function Aa(e,t,n,r,o){let s;try{const i=await _a;if(!i)throw new Error("`respecConfig.github` is not set");const a=r||i.fullName,l=new URL("commits",`${i.apiBase}/${a}/`);e&&l.searchParams.set("from",e),l.searchParams.set("to",t),o&&l.searchParams.set("path",o);const c=await fetch(l.href);if(!c.ok)throw new Error(`Request to ${l} failed with status code ${c.status}`);if(s=await c.json(),!s.length)throw new Error(`No commits between ${e}..${t}.`);s=s.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return s}const Ta=[Object.freeze({__proto__:null,element:La,name:Ca})];var Ra=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ta.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ta.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 Na=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){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=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const Oa="core/linter-rules/check-charset",Pa=Ft({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(如果尚未设置)。'},cs:{msg:"Dokument smí obsahovat pouze jeden tag `<meta>` s charset nastaveným na 'utf-8'",hint:'Přidejte tento řádek do sekce `<head>` vašeho dokumentu - `<meta charset="utf-8">` nebo nastavte charset na "utf-8", pokud ještě není nastaven.'}});var Ia=Object.freeze({__proto__:null,name:Oa,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||an(Pa.msg,Oa,{hint:Pa.hint,elements:[...t]})}});const ja="no-dfn-in-abstract",Da=`core/linter-rules/${ja}`,za=Ft({en:{msg:e=>`Definition \`${e}\` is in an unnumbered section (e.g. abstract or SotD).`,get hint(){return dn`Definitions in unnumbered sections (abstract, SotD) are semantically out of place and appear in the terms index without a section number. Move this definition to a numbered section such as "Terminology". See ${"[export|#data-export]"}.`}}}),Ma=["section#abstract","section#sotd","section.introductory"].join(", ");var qa=Object.freeze({__proto__:null,name:Da,run:function(e){if(!e.lint?.[ja])return;const t=[...document.querySelectorAll("dfn")].filter((e=>e.closest(Ma)));t.forEach((e=>{const t=Bt(e.textContent);an(za.msg(t),Da,{hint:za.hint,elements:[e]})}))}});const Ha="core/linter-rules/check-punctuation",Ba=[".",":","!","?"],Fa=Ba.map((e=>`"${e}"`)).join(", "),Ua=Ft({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Fa}.`},cs:{msg:"Elementy `p` by měly končit interpunkčním znaménkem.",hint:`Ujistěte se, že elementy \`p\` končí jedním z těchto znaků: ${Fa}.`}});var Wa=Object.freeze({__proto__:null,name:Ha,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Ba.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&an(Ua.msg,Ha,{hint:Ua.hint,elements:n})}});const Ga="core/linter-rules/local-refs-exist",Va=Ft({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."},cs:{msg:"V dokumentu byla nalezena nefunkční lokální reference.",hint:"Opravte prosím uvedené odkazy."}});function Za(e){const t=e.getAttribute("href")?.substring(1);if(!t)return;const n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Ya=Object.freeze({__proto__:null,name:Ga,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Za);t.length&&an(Va.msg,Ga,{hint:Va.hint,elements:t})}});const Ka="core/linter-rules/no-headingless-sections",Qa=Ft({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>`。"},cs:{msg:"Všechny sekce musí začínat elementem `h2-6`.",hint:"Přidejte do problematické sekce `h2-6` nebo použijte `<div>`."}});var Xa=Object.freeze({__proto__:null,name:Ka,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&&an(Qa.msg,Ka,{hint:Qa.hint,elements:t})}});const Ja="core/linter-rules/no-unused-vars",el=Ft({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."},cs:{msg:"Proměnná byla definována, ale nikdy nebyla použita.",hint:"Přidejte atribut `data-ignore-unused` k elementu `<var>`."}});var tl=Object.freeze({__proto__:null,name:Ja,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=Bt(e.textContent),n=o.get(t)||o.set(t,[]).get(t);n?.push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&an(el.msg,Ja,{hint:el.hint,elements:t})}});const nl="core/linter-rules/privsec-section",rl=Ft({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/)."},cs:{msg:"Dokument musí obsahovat sekci 'Zásady ochrany soukromí a/nebo bezpečnosti'.",hint:"Přidejte sekci o zásadách ochrany soukromí a/nebo bezpečnosti. Viz [Dotazník pro sebehodnocení](https://w3ctag.github.io/security-questionnaire/)."}});var ol=Object.freeze({__proto__:null,name:nl,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})))&&an(rl.msg,nl,{hint:rl.hint})}});const sl="core/linter-rules/no-http-props",il=Ft({en:{msg:dn`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:dn`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"},cs:{msg:dn`V ${"[respecConfig]"} nejsou povoleny nezabezpečené URL adresy.`,hint:"Změňte prosím následující vlastnosti na 'https://': "}});var al=Object.freeze({__proto__:null,name:sl,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=>dn`${`[${e}]`}`));an(il.msg,sl,{hint:il.hint+e})}}}),ll=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n\nif (document.respec) {\n document.respec.ready.then(setupVarHighlighter);\n} else {\n setupVarHighlighter();\n}\n\nfunction setupVarHighlighter() {\n document\n .querySelectorAll("var")\n .forEach(varElem => varElem.addEventListener("click", highlightListener));\n}\n\n/**\n * @param {MouseEvent} ev\n */\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const varElem = /** @type {HTMLElement} */ (ev.target);\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\n/**\n * @param {HTMLElement} target\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\n/**\n * @param {HTMLElement} varElem\n */\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = /** @type {HTMLElement} */ (\n varElem.closest(".algorithm, section")\n );\n if (!parent) return [];\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll("var")].filter(\n el =>\n norm(el.textContent) === textContent &&\n el.closest(".algorithm, 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\n/**\n * @param {HTMLElement} el\n * @param {string} highlightColor\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\n/**\n * @param {HTMLElement} elem\n * @param {string} highlightColor\n */\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add("respec-hl", highlightColor);\n}\n\n/**\n * Same as `norm` from src/core/utils, but our build process doesn\'t allow\n * imports in runtime scripts, so duplicated here.\n * @param {string} str\n */\nfunction norm(str) {\n return str.trim().replace(/\\s+/g, " ");\n}\n})()'}),cl=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 | null} */\n let panel = null;\n /**\n * @param {KeyboardEvent|MouseEvent} event\n */\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 (\n type === "keydown" &&\n /** @type {KeyboardEvent} */ (event).key !== "Enter"\n )\n return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement | null} */\n const dfn = target.closest("dfn, .index-term");\n if (!dfn?.id) break;\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n if (!panel) break;\n const coords = deriveCoordinates(\n /** @type {MouseEvent|KeyboardEvent} */ (event)\n );\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n if (panel) {\n panel.style.left = "";\n panel.style.top = "";\n panel.classList.add("docked");\n }\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\n const panel = /** @type {HTMLElement} */ (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 | null} */\n const caret = panel.querySelector(".caret");\n if (caret) 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 /**\n * @param {KeyboardEvent} event\n */\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 | null} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}();
527
+ `}};async function Aa(e,t,n,r,o){let i;try{const s=await Sa;if(!s)throw new Error("`respecConfig.github` is not set");const a=r||s.fullName,l=new URL("commits",`${s.apiBase}/${a}/`);e&&l.searchParams.set("from",e),l.searchParams.set("to",t),o&&l.searchParams.set("path",o);const c=await fetch(l.href);if(!c.ok)throw new Error(`Request to ${l} failed with status code ${c.status}`);if(i=await c.json(),!i.length)throw new Error(`No commits between ${e}..${t}.`);i=i.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return i}const La=[Object.freeze({__proto__:null,element:Ca,name:_a})];var Ra=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){La.forEach(e=>{customElements.define(e.name,e.element)});const e=La.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 Ta=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){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=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const Pa="core/linter-rules/check-charset",Oa=Vt({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(如果尚未设置)。'},cs:{msg:"Dokument smí obsahovat pouze jeden tag `<meta>` s charset nastaveným na 'utf-8'",hint:'Přidejte tento řádek do sekce `<head>` vašeho dokumentu - `<meta charset="utf-8">` nebo nastavte charset na "utf-8", pokud ještě není nastaven.'}});var Na=Object.freeze({__proto__:null,name:Pa,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||dn(Oa.msg,Pa,{hint:Oa.hint,elements:[...t]})}});const Ia="no-dfn-in-abstract",ja=`core/linter-rules/${Ia}`,Da=Vt({en:{msg:e=>`Definition \`${e}\` is in an unnumbered section (e.g. abstract or SotD).`,get hint(){return mn`Definitions in unnumbered sections (abstract, SotD) are semantically out of place and appear in the terms index without a section number. Move this definition to a numbered section such as "Terminology". See ${"[export|#data-export]"}.`}}}),za=["section#abstract","section#sotd","section.introductory"].join(", ");var Ma=Object.freeze({__proto__:null,name:ja,run:function(e){if(!e.lint?.[Ia])return;const t=[...document.querySelectorAll("dfn")].filter(e=>e.closest(za));t.forEach(e=>{const t=Gt(e.textContent);dn(Da.msg(t),ja,{hint:Da.hint,elements:[e]})})}});const qa="core/linter-rules/check-punctuation",Ha=[".",":","!","?"],Ba=Ha.map(e=>`"${e}"`).join(", "),Fa=Vt({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Ba}.`},cs:{msg:"Elementy `p` by měly končit interpunkčním znaménkem.",hint:`Ujistěte se, že elementy \`p\` končí jedním z těchto znaků: ${Ba}.`}});var Ua=Object.freeze({__proto__:null,name:qa,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Ha.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter(e=>!t.test(e.textContent.trim()));n.length&&dn(Fa.msg,qa,{hint:Fa.hint,elements:n})}});const Wa="core/linter-rules/local-refs-exist",Ga=Vt({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."},cs:{msg:"V dokumentu byla nalezena nefunkční lokální reference.",hint:"Opravte prosím uvedené odkazy."}});function Va(e){const t=e.getAttribute("href")?.substring(1);if(!t)return;const n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Za=Object.freeze({__proto__:null,name:Wa,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Va);t.length&&dn(Ga.msg,Wa,{hint:Ga.hint,elements:t})}});const Ya="core/linter-rules/no-headingless-sections",Ka=Vt({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>`。"},cs:{msg:"Všechny sekce musí začínat elementem `h2-6`.",hint:"Přidejte do problematické sekce `h2-6` nebo použijte `<div>`."}});var Xa=Object.freeze({__proto__:null,name:Ya,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&&dn(Ka.msg,Ya,{hint:Ka.hint,elements:t})}});const Qa="core/linter-rules/no-unused-vars",Ja=Vt({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."},cs:{msg:"Proměnná byla definována, ale nikdy nebyla použita.",hint:"Přidejte atribut `data-ignore-unused` k elementu `<var>`."}});var el=Object.freeze({__proto__:null,name:Qa,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=Gt(e.textContent),n=o.get(t)||o.set(t,[]).get(t);n?.push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&dn(Ja.msg,Qa,{hint:Ja.hint,elements:t})}});const tl="core/linter-rules/privsec-section",nl=Vt({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/)."},cs:{msg:"Dokument musí obsahovat sekci 'Zásady ochrany soukromí a/nebo bezpečnosti'.",hint:"Přidejte sekci o zásadách ochrany soukromí a/nebo bezpečnosti. Viz [Dotazník pro sebehodnocení](https://w3ctag.github.io/security-questionnaire/)."}});var rl=Object.freeze({__proto__:null,name:tl,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}))&&dn(nl.msg,tl,{hint:nl.hint})}});const ol="core/linter-rules/no-http-props",il=Vt({en:{msg:mn`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:mn`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"},cs:{msg:mn`V ${"[respecConfig]"} nejsou povoleny nezabezpečené URL adresy.`,hint:"Změňte prosím následující vlastnosti na 'https://': "}});var sl=Object.freeze({__proto__:null,name:ol,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=Ut(t,e=>mn`${`[${e}]`}`);dn(il.msg,ol,{hint:il.hint+e})}}}),al=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n\nif (document.respec) {\n document.respec.ready.then(setupVarHighlighter);\n} else {\n setupVarHighlighter();\n}\n\nfunction setupVarHighlighter() {\n document\n .querySelectorAll("var")\n .forEach(varElem => varElem.addEventListener("click", highlightListener));\n}\n\n/**\n * @param {MouseEvent} ev\n */\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const varElem = /** @type {HTMLElement} */ (ev.target);\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\n/**\n * @param {HTMLElement} target\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\n/**\n * @param {HTMLElement} varElem\n */\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = /** @type {HTMLElement} */ (\n varElem.closest(".algorithm, section")\n );\n if (!parent) return [];\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll("var")].filter(\n el =>\n norm(el.textContent) === textContent &&\n el.closest(".algorithm, 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\n/**\n * @param {HTMLElement} el\n * @param {string} highlightColor\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\n/**\n * @param {HTMLElement} elem\n * @param {string} highlightColor\n */\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add("respec-hl", highlightColor);\n}\n\n/**\n * Same as `norm` from src/core/utils, but our build process doesn\'t allow\n * imports in runtime scripts, so duplicated here.\n * @param {string} str\n */\nfunction norm(str) {\n return str.trim().replace(/\\s+/g, " ");\n}\n})()'}),ll=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 | null} */\n let panel = null;\n /**\n * @param {KeyboardEvent|MouseEvent} event\n */\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 (\n type === "keydown" &&\n /** @type {KeyboardEvent} */ (event).key !== "Enter"\n )\n return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement | null} */\n const dfn = target.closest("dfn, .index-term");\n if (!dfn?.id) break;\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n if (!panel) break;\n const coords = deriveCoordinates(\n /** @type {MouseEvent|KeyboardEvent} */ (event)\n );\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n if (panel) {\n panel.style.left = "";\n panel.style.top = "";\n panel.classList.add("docked");\n }\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\n const panel = /** @type {HTMLElement} */ (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 | null} */\n const caret = panel.querySelector(".caret");\n if (caret) 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 /**\n * @param {KeyboardEvent} event\n */\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 | null} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}();
528
528
  //# sourceMappingURL=respec-aom.js.map