diff --git a/builds/respec-w3c.js b/builds/respec-w3c.js index 1ca1480d66..a48e59766f 100644 --- a/builds/respec-w3c.js +++ b/builds/respec-w3c.js @@ -94,7 +94,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} ${Hs}
(plugin: "${e.plugin}")
`:"",n=e.hint?`\n${js(`How to fix: ${us(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`
Occurred ${e.elements.length} times at:
\n ${js(e.elements.map(si).join("\n"))}`:"",s=e.details?`\n\n(plugin: "${e.plugin}")
`:"",n=e.hint?`\n${js(`How to fix: ${us(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`
Occurred ${e.elements.length} times at:
\n ${js(e.elements.map(si).join("\n"))}`:"",s=e.details?`\n\n` block.'})}}(e,r,s))),a=document.body,c=s.definitions,a.querySelectorAll("[data-cddl-pending]").forEach((e=>{const t=`cddl-type:${e.dataset.cddlPending}`;if(c.has(t)){const n=c.get(t);if(!n)return;const r=a.ownerDocument.createElement("a");r.href=`#${n.id}`,r.className="cddl-name",r.dataset.linkType="cddl-type",r.textContent=e.textContent,e.replaceWith(r)}})),document.querySelectorAll("[data-cddl-pending]").forEach((e=>{rs(`No CDDL definition found for \`${e.getAttribute("data-cddl-pending")}\`.`,ul,{elements:[e],hint:"Check for typos in the type name."})})),function(e,t){e.querySelectorAll('a[data-link-type^="cddl-"]:not([href]):not([data-cite])').forEach((e=>{const n=e.getAttribute("data-link-type"),r=e.getAttribute("data-xref-for")||e.getAttribute("data-link-for")||"",s=e.textContent.trim();if("cddl-type"!==n&&"cddl-key"!==n&&"cddl-value"!==n)return;const i={"cddl-type":`cddl-type:${s}`,"cddl-key":`cddl-key:${r}/${s}`,"cddl-value":`cddl-value:${r}/${s}`}[n];if(t.has(i)){const n=t.get(i);if(!n)return;e.setAttribute("href",`#${n.id}`),e.classList.add("internalDFN")}else rs(`CDDL ${n}: no definition found for \`${s}\`${r?`, for \`${r}\`,`:""} in any \`\` block.`,ul,{elements:[e]}),e.setAttribute("data-no-link-to-dfn","")}))}(document,s.definitions),function(e,t){t.forEach((t=>{const n=e.getElementById(t.id);"dfn"===n?.localName&&pc(n,[n.textContent.trim()])}))}(document,s.definitions),Vc(),hs("beforesave",(e=>{e.querySelectorAll("[data-cddl-pending]").forEach((e=>e.removeAttribute("data-cddl-pending")))}))}});const bl="core/data-cite",yl="__SPEC__";async function wl(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===yl)i=document.location.href;else{const e=await ka(t);if(!e)return null;i=e.href??"",o=e.title}if(s)i=s;else{if(r){const e=r.startsWith("/")?`.${r}`:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:o}}function vl(e,t,n){const{href:r,title:s}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?Vr(e,t):(t.textContent=s,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){ns("Exporting a linked external definition is not allowed.",bl,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function kl(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const $l=kl("#"),xl=kl("/");function Cl(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:i}=t;if((n??"").startsWith("#")&&!r){const r=e.parentElement?.closest('[data-cite]:not([data-cite^="#"])')??null,{key:s,isNormative:i}=r?Cl(r):{key:yl,isNormative:!1};return t.cite=i?s:`?${s}`,t.citeFrag=(n??"").replace("#",""),Cl(e)}const o=r?`#${r}`:$l(n??""),a=s||xl(n??"").split("#")[0],{type:c}=Gr(n??"",e),l="normative"===c,u=/^[?|!]/.test(n??"");return{key:(n??"").split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:o,path:a,href:i}}function Sl(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 _l=Object.freeze({__proto__:null,THIS_SPEC:yl,name:bl,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(Cl).map((async e=>({entry:e,result:await ka(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await va(n);r&&Object.assign(ma,r)}([...e]);const t=new Map,n=new Map;for(const r of e){t.set(r,r.dataset.cite);const e=Cl(r);n.set(r,e)}for(const r of e){const e=t.get(r),s=n.get(r),i=await wl(s);if(i)r.dataset.citeFrag&&r.dataset.matchedText||!r.dataset.lt||"the-empty-string"===r.dataset.lt||""!==r.textContent||(r.textContent=r.dataset.lt,delete r.dataset.lt),vl(r,i,s);else{const t=`Couldn't find a match for "${e}"`;r.dataset.matchedText&&(r.textContent=r.dataset.matchedText),rs(t,bl,{elements:[r]})}}hs("beforesave",Sl)},toCiteDetails:Cl});const Tl="core/link-to-dfn",Rl=[],El={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."}},Ll=Ir(El);function Al(e){const t=new Map,n=[];for(const r of dc.get(e)??[]){const{dfnType:s="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const o of i){if(t.has(o)&&t.get(o)?.has(s)){const e=t.get(o)?.get(s),i="dfn"===e?.localName,a="dfn"===r.localName,c=s===(e?.dataset.dfnType||"dfn"),l=!o&&!e?.dataset.dfnFor||e?.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(o);if(i&&a&&c&&l){n.push(r);continue}}t.has(o)||t.set(o,new Map),t.get(o)?.set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(o)?.set("idl",r),Fr(r,"dfn",e)}}return{result:t,duplicates:n}}function Pl(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor??"":"",r=Br(e).reduce(((e,r)=>{const s=r.split(".");2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r});const i=r.replace(yr,"");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 s=t.get(r.title)?.get(r.for),{linkType:i}=e.dataset;if(i){for(const e of i.split("|"))if(s?.get(e))return s.get(e);return s?.get("dfn")}{const e=r.for?"idl":"dfn";return s?.get(e)||s?.get("idl")}}function Nl(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&i&&!i.split(",").map((e=>e.trim())).includes(s))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=Il(e)&&Il(t,n);r&&!s||Vr(e,document.createElement("code"))}(e,t),!r}function Il(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 Dl(e){e.forEach((e=>{const t=`Found linkless \`\` element with text "${e.textContent}" but no matching \`\``,n=e.closest("[data-link-for]"),r=`Add a matching \`\` element, ${ls`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 \`\` or move it outside the scoped section.`:""}`;rs(t,Tl,{title:"Linking error: no matching ``",hint:r,elements:[e]})}))}var Ol=Object.freeze({__proto__:null,name:Tl,possibleExternalLinks:Rl,run:async function(e){const t=function(){const e=new es;for(const t of dc.keys()){const{result:n,duplicates:r}=Al(t);e.set(t,n),r.length>0&&ns(Ll.duplicateMsg(t),Tl,{title:Ll.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){Rl.push(e);continue}const r=Pl(e,t);if(r){Nl(e,r,t)||Rl.push(e)}else""===e.dataset.cite?n.push(e):Rl.push(e)}Dl(n),function(e){const{shortName:t=""}=e,n=t?new RegExp(String.raw`^([?!])?${vr(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${yl}$2`));const{key:r,isNormative:s}=Cl(t);r!==yl&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Dl(Rl)}});const jl="xrefs",zl=3e5;async function Ml(){return await ir.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(jl,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Ul(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e)??"",10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-tt}())return await async function(){try{await Ml().then((e=>e.clear(jl)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await Ml();let r=await e.transaction(jl).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const ql="core/xref",Wl={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},Fl="https://respec.org/xref/",Bl=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Sr({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Hl(e){const t="xrefType"in e.dataset;let n=Gl(e,{isIDL:t});t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=(n.dataset.cite??"").toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter((e=>e));if(r.length){t.push(r);const e=Jl(r);e.length&&t.push(e)}if(n===e)break;n=n.parentElement?.closest("[data-cite]")??null}if(n!==e){const n=e.closest("section"),r=n?n.querySelectorAll("a.bibref"):[],s=[...new Set([...r].map((e=>e.textContent.toLowerCase())))];if(s.length){t.push(s);const e=Jl(s);e.length&&t.push(e)}}const r=function(e){const t=[],n=new Set;for(const r of e){const e=[...new Set(r).values().filter((e=>!n.has(e)))];e.forEach((e=>n.add(e))),t.push(e.sort())}return t}(t);return r}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return Nr(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return Nr(t.dataset.xrefFor??"")}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function Gl(e,{isIDL:t=!1}={}){const{lt:n}=e.dataset;let r=n?n.split("|",1)[0]:e.textContent;return r=Nr(r),"the-empty-string"===r?"":(t||n||(r=r.replace(yr,"")),r)}function Vl(e){return e.replace(/-\d+$/,"")}function Jl(e){return[...new Set(e.map(Vl)).difference(new Set(e))]}function Kl(e,t,n,r){const{term:s,specs:i=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=i.flat().includes(c)?c:a,h=new URL(o,"https://partial");let{pathname:f}=h;"/"===f&&(f="");const m={cite:p,citePath:f,citeFrag:h.hash.slice(1),linkType:u};d&&(m.linkFor=d[0]),h.origin&&"https://partial"!==h.origin&&(m.citeHref=h.href),Object.assign(e.dataset,m),function(e,t,n,r,s){const i=function(e){const t=e.closest(".normative"),n=e.closest(Cr);return!n||e===t||t&&n&&n.contains(t)}(e);if(!i)return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t)??t:t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}Bl.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Zl(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Yl)}function Yl(e){const t=new Uint8Array(e);return t.toHex?.()??[...t].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Xl(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach((e=>{n.forEach((t=>e.removeAttribute(t)))}))}var Ql=Object.freeze({__proto__:null,API_URL:Fl,getTermFromElement:Gl,informativeRefsInNormative:Bl,name:ql,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",Fl).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":{const t=e;t.toLowerCase()in Wl?Object.assign(n,{specs:Wl[t.toLowerCase()]}):r(t);break}case"array":Object.assign(n,{specs:e});break;case"object":{const t=e;if(Object.assign(n,t),t.profile){const e=t.profile.toLowerCase();if(e in Wl){const r=(t.specs??[]).concat(Wl[e]);Object.assign(n,{specs:r})}else r(t.profile)}break}default:{const t=ls`Expected: \`true\`, a profile name (e.g. \`"web-platform"\`), an array of spec shortnames (e.g. \`["FETCH", "DOM"]\`), or an object with \`url\`, \`specs\`, or \`profile\` properties. See ${"[xref]"}.`;ns(`Invalid value for \`xref\` configuration option. Received: "${e}".`,ql,{hint:t})}}return n;function r(e){ns(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${Ar(Object.keys(Wl),(e=>`"${e}"`))}.`,ql)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=Rl.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])"),t=document.querySelectorAll("dfn.externalDFN");return[...e].filter((e=>{if(""===e.textContent.trim())return!1;const t=e.closest("[data-cite]");return!t||""!==t.dataset.cite})).concat(...t)}());if(!n.length)return;const r=[];for(const e of n){const t=Hl(e);t.id=await Zl(t),r.push(t)}const s=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await Ul(r),i=r.filter((e=>!s.get(e.id))),o=await async function(e,t){if(!e.length)return new Map;const n={method:"POST",body:JSON.stringify({queries:e}),headers:{"Content-Type":"application/json"}},r=await fetch(t,n),s=await r.json();return new Map(s.results.map((({id:e,result:t})=>[e,t])))}(i,t);o.size&&await async function(e,t){try{const n=(await Ml()).transaction(jl,"readwrite");for(const r of e){const e=t.get(r.id);e?.length&&n.objectStore(jl).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...s,...o])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let i=0,o=e.length;i{const r=new URL(Fl);return r.searchParams.set("term",e),t.for&&r.searchParams.set("for",t.for),r.searchParams.set("types",t.types.join(",")),n.length&&r.searchParams.set("specs",n.join(",")),r.href},r=(e,t)=>ls`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:s}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],i=Gl(s[0]),o=n(i,e),a=Lr(t,(e=>`**[${e}]**`));let c=r(o,i);const l=s[0].parentElement?.closest("[data-cite]")??null,u=l?.dataset.cite?.replace(/`/g,"")??"";l&&l!==document.body&&u&&(c+=` A parent element has \`data-cite="${u}"\` — check that the spec shortname is correct.`);ns(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,ql,{title:"No matching definition found.",elements:s,hint:c})}for(const{query:t,elems:s,results:i}of e.values()){const e=[...new Set(i.map((e=>e.shortname)))].sort(),o=Lr(e,(e=>`**[${e}]**`)),a=Gl(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=r(c,a),d=ls`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${u}`;ns(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,ql,{title:"Definition is ambiguous.",elements:s,hint:d})}}(s)}(n,r,s,e),hs("beforesave",Xl)}});const eu="headings",tu=864e5;async function nu(){return await ir.openDB("respec-headings",1,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t))),e.createObjectStore(eu)}})}async function ru(e){const t=new Map;if(function(){const e=parseInt(localStorage.getItem("HEADINGS:LAST_CACHED")??"",10);return!isNaN(e)&&Date.now()-e>tu}())return await async function(){try{const e=await nu();await e.clear(eu),localStorage.removeItem("HEADINGS:LAST_CACHED")}catch(e){console.error(e)}}(),t;try{const n=(await nu()).transaction(eu);for(const r of e){const e=`${r.spec}#${r.id}`,s=await n.store.get(e);s&&t.set(e,s.result)}}catch(e){console.error(e)}return t}const su="core/xref-headings",iu="https://respec.org/xref/search/headings";async function ou(e,t=iu){if(!e.length)return new Map;const n=await ru(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 rs(t,su,{hint:"Cross-spec section links will fall back to spec titles."}),n}const{result:s=[]}=await e.json(),i=new Map(s.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 nu()).transaction(eu,"readwrite");for(const r of e){const e=`${r.spec}#${r.id}`,s=t.get(e);s&&n.objectStore(eu).put({query:r,result:s},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 rs("Failed to fetch heading texts from respec.org.",su,{hint:"Cross-spec section links will fall back to spec titles."}),n}}function au(e,{title:t,number:n}){n?e.append(sr`${n} `,t):e.textContent=t}var cu=Object.freeze({__proto__:null,HEADINGS_API_URL:iu,fetchHeadingTexts:ou,name:su,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:iu}(e),r=new Map,s=[];if(t.forEach((e=>{if(e.dataset.lt)e.textContent=e.dataset.lt,delete e.dataset.lt;else{const t=(e.dataset.cite??"").replace(/^[!?]/,""),n=e.dataset.citeFrag??"",i=`${t}#${n}`;s.push({elem:e,key:i}),r.has(i)||r.set(i,{spec:t,id:n})}})),!s.length)return;const i=await ou([...r.values()],n);s.forEach((({elem:e,key:t})=>{const n=i.get(t);n?.title&&(e.textContent="",au(e,n))}))},setHeadingContent:au});var lu=String.raw`ul.index{columns:30ch;column-gap:1.5em}
+ >`}}switch(r.type){case"text":return fl`${Pr(i)}`;case"number":case"float":return fl`${Pr(i)}`;case"bytes":case"hex":case"base64":return fl`${Pr(i)}`;default:return Pr(i)}}#i(e){const t=e.parentNode;return!!t&&t instanceof gr}serializeToken(e,t){const n=e.type,r=e.serialize();switch(n){case"COMMENT":return this.#o(r);case"CTLOP":return this.#a(r);case"=":case"/=":case"//=":case"/":case"//":case"=>":case"..":case"...":return this.#c(r);case"?":case"*":case"+":return t instanceof br?this.#l(r):r;default:return r}}#o(e){return e.replace(/(;[^\n]*)/g,'$1')}#a(e){return e.replace(/(\.\w+)/g,'$1')}#c(e){const t=e.match(/^(\s*)(.*?)(\s*)$/s);return t?`${t[1]}${t[2]}${t[3]}`:fl`${e}`}#l(e){const t=e.match(/^(\s*)(.*?)(\s*)$/s);return t?`${t[1]}${t[2]}${t[3]}`:fl`${e}`}}function gl(e){const t=e.dataset.dfnType,n=e.textContent.trim(),r=e.dataset.dfnFor||"";switch(t){case"cddl-type":return`cddl-type:${n}`;case"cddl-key":return r?`cddl-key:${r}/${n}`:null;case"cddl-value":return r?`cddl-value:${r}/${n}`:null;default:return null}}function bl(e){const t=e.dataset.dfnType;if("cddl-type"!==t&&"cddl-key"!==t&&"cddl-value"!==t)return null;const n=e.dataset.dfnFor,r=e.textContent.trim(),s=n?`${pl(n)}-`:"";return`cddl-${t.replace("cddl-","")}-${s}${pl(r)}`}var yl=Object.freeze({__proto__:null,name:ul,run:async function(){const e=document.querySelectorAll("pre.cddl:not([data-no-cddl])");if(!e.length)return;const t=document.createElement("style");t.textContent=ll;const n=document.querySelector("head link, head > *:last-child");n?n.before(t):document.head.append(t);const r=e=>new ur(e).parse(),s={definitions:new Map,proseDfns:new Map,genericParams:new Map};var i,o,a,c;i=document,o=s.proseDfns,i.querySelectorAll(["dfn[data-dfn-type='cddl-type']","dfn[data-dfn-type='cddl-key']","dfn[data-dfn-type='cddl-value']"].join(", ")).forEach((e=>{const t=bl(e);t&&(e.id||=t,o.set(t,e.id))})),e.forEach((e=>function(e,t,n){const r=e.textContent;if(r.trim())try{const s=t(r),i=new ml(n),o=s.serialize(i),a=document.createElement("code");a.innerHTML=o,e.textContent="",e.append(a),e.classList.add("def","highlight"),qr(e,"cddl-block");const c=document.createElement("span");c.className="cddlHeader",c.innerHTML=`CDDL`;const l=Gc(".cddlHeader");c.append(l),e.prepend(c)}catch(t){ns(`CDDL processing error: ${t instanceof Error?t.message:String(t)}`,ul,{elements:[e],hint:'Check the CDDL syntax in the `` block.'})}}(e,r,s))),function(e,t){const n=new Map;e.querySelectorAll(["dfn[data-dfn-type='cddl-type']","dfn[data-dfn-type='cddl-key']","dfn[data-dfn-type='cddl-value']"].join(", ")).forEach((e=>{if(e.closest("pre.cddl"))return;const t=bl(e);t&&(e.id||=t);const r=gl(e);r&&n.set(r,e.id)})),e.querySelectorAll("pre.cddl dfn[data-dfn-type^='cddl-']").forEach((r=>{const s=gl(r),i=s?n.get(s):null;if(!s||!i)return;const o=e.createElement("a");o.href=`#${i}`,o.className=r.className,o.dataset.linkType=r.dataset.dfnType||"",r.dataset.dfnFor&&(o.dataset.xrefFor=r.dataset.dfnFor),o.textContent=r.textContent,r.replaceWith(o);const a=t.get(s);a&&(a.id=i)}))}(document,s.definitions),a=document.body,c=s.definitions,a.querySelectorAll("[data-cddl-pending]").forEach((e=>{const t=`cddl-type:${e.dataset.cddlPending}`;if(c.has(t)){const n=c.get(t);if(!n)return;const r=a.ownerDocument.createElement("a");r.href=`#${n.id}`,r.className="cddl-name",r.dataset.linkType="cddl-type",r.textContent=e.textContent,e.replaceWith(r)}})),document.querySelectorAll("[data-cddl-pending]").forEach((e=>{rs(`No CDDL definition found for \`${e.getAttribute("data-cddl-pending")}\`.`,ul,{elements:[e],hint:"Check for typos in the type name."})})),function(e,t){e.querySelectorAll('a[data-link-type^="cddl-"]:not([href]):not([data-cite])').forEach((e=>{const n=e.getAttribute("data-link-type"),r=e.getAttribute("data-xref-for")||e.getAttribute("data-link-for")||"",s=e.textContent.trim();if("cddl-type"!==n&&"cddl-key"!==n&&"cddl-value"!==n)return;const i={"cddl-type":`cddl-type:${s}`,"cddl-key":`cddl-key:${r}/${s}`,"cddl-value":`cddl-value:${r}/${s}`}[n];if(t.has(i)){const n=t.get(i);if(!n)return;e.setAttribute("href",`#${n.id}`),e.classList.add("internalDFN")}else rs(`CDDL ${n}: no definition found for \`${s}\`${r?`, for \`${r}\`,`:""} in any \`\` block.`,ul,{elements:[e]}),e.setAttribute("data-no-link-to-dfn","")}))}(document,s.definitions),function(e,t){t.forEach((t=>{const n=e.getElementById(t.id);"dfn"===n?.localName&&n.closest("pre.cddl")&&pc(n,[n.textContent.trim()])}))}(document,s.definitions),Vc(),hs("beforesave",(e=>{e.querySelectorAll("[data-cddl-pending]").forEach((e=>e.removeAttribute("data-cddl-pending")))}))}});const wl="core/data-cite",vl="__SPEC__";async function kl(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===vl)i=document.location.href;else{const e=await ka(t);if(!e)return null;i=e.href??"",o=e.title}if(s)i=s;else{if(r){const e=r.startsWith("/")?`.${r}`:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:o}}function $l(e,t,n){const{href:r,title:s}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?Vr(e,t):(t.textContent=s,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){ns("Exporting a linked external definition is not allowed.",wl,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function xl(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Cl=xl("#"),Sl=xl("/");function _l(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:i}=t;if((n??"").startsWith("#")&&!r){const r=e.parentElement?.closest('[data-cite]:not([data-cite^="#"])')??null,{key:s,isNormative:i}=r?_l(r):{key:vl,isNormative:!1};return t.cite=i?s:`?${s}`,t.citeFrag=(n??"").replace("#",""),_l(e)}const o=r?`#${r}`:Cl(n??""),a=s||Sl(n??"").split("#")[0],{type:c}=Gr(n??"",e),l="normative"===c,u=/^[?|!]/.test(n??"");return{key:(n??"").split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:o,path:a,href:i}}function Tl(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 Rl=Object.freeze({__proto__:null,THIS_SPEC:vl,name:wl,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(_l).map((async e=>({entry:e,result:await ka(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await va(n);r&&Object.assign(ma,r)}([...e]);const t=new Map,n=new Map;for(const r of e){t.set(r,r.dataset.cite);const e=_l(r);n.set(r,e)}for(const r of e){const e=t.get(r),s=n.get(r),i=await kl(s);if(i)r.dataset.citeFrag&&r.dataset.matchedText||!r.dataset.lt||"the-empty-string"===r.dataset.lt||""!==r.textContent||(r.textContent=r.dataset.lt,delete r.dataset.lt),$l(r,i,s);else{const t=`Couldn't find a match for "${e}"`;r.dataset.matchedText&&(r.textContent=r.dataset.matchedText),rs(t,wl,{elements:[r]})}}hs("beforesave",Tl)},toCiteDetails:_l});const El="core/link-to-dfn",Ll=[],Al={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."}},Pl=Ir(Al);function Nl(e){const t=new Map,n=[];for(const r of dc.get(e)??[]){const{dfnType:s="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const o of i){if(t.has(o)&&t.get(o)?.has(s)){const e=t.get(o)?.get(s),i="dfn"===e?.localName,a="dfn"===r.localName,c=s===(e?.dataset.dfnType||"dfn"),l=!o&&!e?.dataset.dfnFor||e?.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(o);if(i&&a&&c&&l){n.push(r);continue}}t.has(o)||t.set(o,new Map),t.get(o)?.set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(o)?.set("idl",r),Fr(r,"dfn",e)}}return{result:t,duplicates:n}}function Il(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor??"":"",r=Br(e).reduce(((e,r)=>{const s=r.split(".");2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r});const i=r.replace(yr,"");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 s=t.get(r.title)?.get(r.for),{linkType:i}=e.dataset;if(i){for(const e of i.split("|"))if(s?.get(e))return s.get(e);return s?.get("dfn")}{const e=r.for?"idl":"dfn";return s?.get(e)||s?.get("idl")}}function Dl(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&i&&!i.split(",").map((e=>e.trim())).includes(s))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=Ol(e)&&Ol(t,n);r&&!s||Vr(e,document.createElement("code"))}(e,t),!r}function Ol(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 jl(e){e.forEach((e=>{const t=`Found linkless \`\` element with text "${e.textContent}" but no matching \`\``,n=e.closest("[data-link-for]"),r=`Add a matching \`\` element, ${ls`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 \`\` or move it outside the scoped section.`:""}`;rs(t,El,{title:"Linking error: no matching ``",hint:r,elements:[e]})}))}var zl=Object.freeze({__proto__:null,name:El,possibleExternalLinks:Ll,run:async function(e){const t=function(){const e=new es;for(const t of dc.keys()){const{result:n,duplicates:r}=Nl(t);e.set(t,n),r.length>0&&ns(Pl.duplicateMsg(t),El,{title:Pl.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){Ll.push(e);continue}const r=Il(e,t);if(r){Dl(e,r,t)||Ll.push(e)}else""===e.dataset.cite?n.push(e):Ll.push(e)}jl(n),function(e){const{shortName:t=""}=e,n=t?new RegExp(String.raw`^([?!])?${vr(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${vl}$2`));const{key:r,isNormative:s}=_l(t);r!==vl&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||jl(Ll)}});const Ml="xrefs",Ul=3e5;async function ql(){return await ir.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(Ml,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Wl(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e)??"",10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-tt}())return await async function(){try{await ql().then((e=>e.clear(Ml)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await ql();let r=await e.transaction(Ml).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const Fl="core/xref",Bl={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},Hl="https://respec.org/xref/",Gl=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Sr({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Vl(e){const t="xrefType"in e.dataset;let n=Jl(e,{isIDL:t});t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=(n.dataset.cite??"").toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter((e=>e));if(r.length){t.push(r);const e=Zl(r);e.length&&t.push(e)}if(n===e)break;n=n.parentElement?.closest("[data-cite]")??null}if(n!==e){const n=e.closest("section"),r=n?n.querySelectorAll("a.bibref"):[],s=[...new Set([...r].map((e=>e.textContent.toLowerCase())))];if(s.length){t.push(s);const e=Zl(s);e.length&&t.push(e)}}const r=function(e){const t=[],n=new Set;for(const r of e){const e=[...new Set(r).values().filter((e=>!n.has(e)))];e.forEach((e=>n.add(e))),t.push(e.sort())}return t}(t);return r}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return Nr(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return Nr(t.dataset.xrefFor??"")}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function Jl(e,{isIDL:t=!1}={}){const{lt:n}=e.dataset;let r=n?n.split("|",1)[0]:e.textContent;return r=Nr(r),"the-empty-string"===r?"":(t||n||(r=r.replace(yr,"")),r)}function Kl(e){return e.replace(/-\d+$/,"")}function Zl(e){return[...new Set(e.map(Kl)).difference(new Set(e))]}function Yl(e,t,n,r){const{term:s,specs:i=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=i.flat().includes(c)?c:a,h=new URL(o,"https://partial");let{pathname:f}=h;"/"===f&&(f="");const m={cite:p,citePath:f,citeFrag:h.hash.slice(1),linkType:u};d&&(m.linkFor=d[0]),h.origin&&"https://partial"!==h.origin&&(m.citeHref=h.href),Object.assign(e.dataset,m),function(e,t,n,r,s){const i=function(e){const t=e.closest(".normative"),n=e.closest(Cr);return!n||e===t||t&&n&&n.contains(t)}(e);if(!i)return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t)??t:t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}Gl.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Xl(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Ql)}function Ql(e){const t=new Uint8Array(e);return t.toHex?.()??[...t].map((e=>e.toString(16).padStart(2,"0"))).join("")}function eu(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach((e=>{n.forEach((t=>e.removeAttribute(t)))}))}var tu=Object.freeze({__proto__:null,API_URL:Hl,getTermFromElement:Jl,informativeRefsInNormative:Gl,name:Fl,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",Hl).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":{const t=e;t.toLowerCase()in Bl?Object.assign(n,{specs:Bl[t.toLowerCase()]}):r(t);break}case"array":Object.assign(n,{specs:e});break;case"object":{const t=e;if(Object.assign(n,t),t.profile){const e=t.profile.toLowerCase();if(e in Bl){const r=(t.specs??[]).concat(Bl[e]);Object.assign(n,{specs:r})}else r(t.profile)}break}default:{const t=ls`Expected: \`true\`, a profile name (e.g. \`"web-platform"\`), an array of spec shortnames (e.g. \`["FETCH", "DOM"]\`), or an object with \`url\`, \`specs\`, or \`profile\` properties. See ${"[xref]"}.`;ns(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Fl,{hint:t})}}return n;function r(e){ns(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${Ar(Object.keys(Bl),(e=>`"${e}"`))}.`,Fl)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=Ll.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])"),t=document.querySelectorAll("dfn.externalDFN");return[...e].filter((e=>{if(""===e.textContent.trim())return!1;const t=e.closest("[data-cite]");return!t||""!==t.dataset.cite})).concat(...t)}());if(!n.length)return;const r=[];for(const e of n){const t=Vl(e);t.id=await Xl(t),r.push(t)}const s=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await Wl(r),i=r.filter((e=>!s.get(e.id))),o=await async function(e,t){if(!e.length)return new Map;const n={method:"POST",body:JSON.stringify({queries:e}),headers:{"Content-Type":"application/json"}},r=await fetch(t,n),s=await r.json();return new Map(s.results.map((({id:e,result:t})=>[e,t])))}(i,t);o.size&&await async function(e,t){try{const n=(await ql()).transaction(Ml,"readwrite");for(const r of e){const e=t.get(r.id);e?.length&&n.objectStore(Ml).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...s,...o])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let i=0,o=e.length;i{const r=new URL(Hl);return r.searchParams.set("term",e),t.for&&r.searchParams.set("for",t.for),r.searchParams.set("types",t.types.join(",")),n.length&&r.searchParams.set("specs",n.join(",")),r.href},r=(e,t)=>ls`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:s}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],i=Jl(s[0]),o=n(i,e),a=Lr(t,(e=>`**[${e}]**`));let c=r(o,i);const l=s[0].parentElement?.closest("[data-cite]")??null,u=l?.dataset.cite?.replace(/`/g,"")??"";l&&l!==document.body&&u&&(c+=` A parent element has \`data-cite="${u}"\` — check that the spec shortname is correct.`);ns(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,Fl,{title:"No matching definition found.",elements:s,hint:c})}for(const{query:t,elems:s,results:i}of e.values()){const e=[...new Set(i.map((e=>e.shortname)))].sort(),o=Lr(e,(e=>`**[${e}]**`)),a=Jl(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=r(c,a),d=ls`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${u}`;ns(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,Fl,{title:"Definition is ambiguous.",elements:s,hint:d})}}(s)}(n,r,s,e),hs("beforesave",eu)}});const nu="headings",ru=864e5;async function su(){return await ir.openDB("respec-headings",1,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t))),e.createObjectStore(nu)}})}async function iu(e){const t=new Map;if(function(){const e=parseInt(localStorage.getItem("HEADINGS:LAST_CACHED")??"",10);return!isNaN(e)&&Date.now()-e>ru}())return await async function(){try{const e=await su();await e.clear(nu),localStorage.removeItem("HEADINGS:LAST_CACHED")}catch(e){console.error(e)}}(),t;try{const n=(await su()).transaction(nu);for(const r of e){const e=`${r.spec}#${r.id}`,s=await n.store.get(e);s&&t.set(e,s.result)}}catch(e){console.error(e)}return t}const ou="core/xref-headings",au="https://respec.org/xref/search/headings";async function cu(e,t=au){if(!e.length)return new Map;const n=await iu(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 rs(t,ou,{hint:"Cross-spec section links will fall back to spec titles."}),n}const{result:s=[]}=await e.json(),i=new Map(s.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 su()).transaction(nu,"readwrite");for(const r of e){const e=`${r.spec}#${r.id}`,s=t.get(e);s&&n.objectStore(nu).put({query:r,result:s},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 rs("Failed to fetch heading texts from respec.org.",ou,{hint:"Cross-spec section links will fall back to spec titles."}),n}}function lu(e,{title:t,number:n}){n?e.append(sr`${n} `,t):e.textContent=t}var uu=Object.freeze({__proto__:null,HEADINGS_API_URL:au,fetchHeadingTexts:cu,name:ou,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:au}(e),r=new Map,s=[];if(t.forEach((e=>{if(e.dataset.lt)e.textContent=e.dataset.lt,delete e.dataset.lt;else{const t=(e.dataset.cite??"").replace(/^[!?]/,""),n=e.dataset.citeFrag??"",i=`${t}#${n}`;s.push({elem:e,key:i}),r.has(i)||r.set(i,{spec:t,id:n})}})),!s.length)return;const i=await cu([...r.values()],n);s.forEach((({elem:e,key:t})=>{const n=i.get(t);n?.title&&(e.textContent="",lu(e,n))}))},setHeadingContent:lu});var du=String.raw`ul.index{columns:30ch;column-gap:1.5em}
ul.index li{list-style:inherit}
ul.index li span{color:inherit;cursor:pointer;white-space:normal}
#index-defined-here ul.index li{font-size:.9rem}
@@ -1084,37 +1090,37 @@ ul.index code{color:inherit}
#index-defined-here .print-only{display:none}
@media print{
#index-defined-here .print-only{display:initial}
-}`;const uu=Ir({en:{heading:"Index",headingExternal:"Terms defined by reference",headingLocal:"Terms defined by this specification",dfnOf:"definition of",definesFollowing:"defines the following:"},cs:{heading:"Glosář",headingExternal:"Termíny definované odkazem",headingLocal:"Termíny definované touto specifikací",dfnOf:"definice",definesFollowing:"definuje následující:"},de:{heading:"Index",headingExternal:"Begriffe, die durch Verweis definiert sind",headingLocal:"Begriffe, die in dieser Spezifikation definiert sind",dfnOf:"Definition von",definesFollowing:"definiert Folgendes:"},es:{heading:"Índice",headingExternal:"Términos definidos por referencia",headingLocal:"Términos definidos por esta especificación",dfnOf:"definición de",definesFollowing:"define lo siguiente:"},ja:{heading:"索引",headingExternal:"参照によって定義された用語",headingLocal:"この仕様で定義された用語",dfnOf:"の定義",definesFollowing:"以下を定義します:"},ko:{heading:"색인",headingExternal:"참조로 정의된 용어",headingLocal:"이 명세서에서 정의된 용어",dfnOf:"정의",definesFollowing:"다음을 정의합니다:"},nl:{heading:"Index",headingExternal:"Termen gedefinieerd door verwijzing",headingLocal:"Termen gedefinieerd door deze specificatie",dfnOf:"definitie van",definesFollowing:"definieert het volgende:"},zh:{heading:"索引",headingExternal:"通过引用定义的术语",headingLocal:"由本规范定义的术语",dfnOf:"的定义",definesFollowing:"定义以下内容:"}}),du=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function pu(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function hu(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?.dataset.dfnFor||""}function fu(e,t,n=""){if(n.startsWith("[[")){return`internal slot for ${hu(e)}`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for ${hu(e)}`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for ${hu(e)}`;default:return""}}function mu(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>{const t=(e=>{const t=document.getElementById(e),n=t?.closest("section:not(.notoc)")?.querySelector(".secno");if(!n)return null;const r=`§${n.textContent.trim()}`;return sr`${r}`})(e.dataset.id??"");t&&e.append(t)}))}function gu(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const{cite:n,citeFrag:s,xrefType:i,linkType:o,matchedText:a}=r.dataset;if(s&&a)continue;if(!(i||o||n.includes("#")||s))continue;const c=r.href;if(e.has(c))continue;const{linkType:l,linkFor:u}=r.dataset,d=Gl(r);if(!d)continue;const p=Cl(r).key.toUpperCase(),h=t.get(p)||t.set(p,[]).get(p);h?.push({term:d,type:l,linkFor:u,elem:r}),e.add(c)}return t}function bu(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=Pr(t);du.has(n??"")&&("extended-attribute"===n&&(s=`[${s}]`),s=`${s}`);const i=wu.has(t)?"type":yu.get(n??"");i&&(s+=` ${i}`);if(r){let e=r;/\s/.test(r)||(e=`${e}`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return sr`-
+}`;const pu=Ir({en:{heading:"Index",headingExternal:"Terms defined by reference",headingLocal:"Terms defined by this specification",dfnOf:"definition of",definesFollowing:"defines the following:"},cs:{heading:"Glosář",headingExternal:"Termíny definované odkazem",headingLocal:"Termíny definované touto specifikací",dfnOf:"definice",definesFollowing:"definuje následující:"},de:{heading:"Index",headingExternal:"Begriffe, die durch Verweis definiert sind",headingLocal:"Begriffe, die in dieser Spezifikation definiert sind",dfnOf:"Definition von",definesFollowing:"definiert Folgendes:"},es:{heading:"Índice",headingExternal:"Términos definidos por referencia",headingLocal:"Términos definidos por esta especificación",dfnOf:"definición de",definesFollowing:"define lo siguiente:"},ja:{heading:"索引",headingExternal:"参照によって定義された用語",headingLocal:"この仕様で定義された用語",dfnOf:"の定義",definesFollowing:"以下を定義します:"},ko:{heading:"색인",headingExternal:"참조로 정의된 용어",headingLocal:"이 명세서에서 정의된 용어",dfnOf:"정의",definesFollowing:"다음을 정의합니다:"},nl:{heading:"Index",headingExternal:"Termen gedefinieerd door verwijzing",headingLocal:"Termen gedefinieerd door deze specificatie",dfnOf:"definitie van",definesFollowing:"definieert het volgende:"},zh:{heading:"索引",headingExternal:"通过引用定义的术语",headingLocal:"由本规范定义的术语",dfnOf:"的定义",definesFollowing:"定义以下内容:"}}),hu=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function fu(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function mu(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?.dataset.dfnFor||""}function gu(e,t,n=""){if(n.startsWith("[[")){return`internal slot for
${mu(e)}`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for ${mu(e)}`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for ${mu(e)}`;default:return""}}function bu(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>{const t=(e=>{const t=document.getElementById(e),n=t?.closest("section:not(.notoc)")?.querySelector(".secno");if(!n)return null;const r=`§${n.textContent.trim()}`;return sr`${r}`})(e.dataset.id??"");t&&e.append(t)}))}function yu(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const{cite:n,citeFrag:s,xrefType:i,linkType:o,matchedText:a}=r.dataset;if(s&&a)continue;if(!(i||o||n.includes("#")||s))continue;const c=r.href;if(e.has(c))continue;const{linkType:l,linkFor:u}=r.dataset,d=Jl(r);if(!d)continue;const p=_l(r).key.toUpperCase(),h=t.get(p)||t.set(p,[]).get(p);h?.push({term:d,type:l,linkFor:u,elem:r}),e.add(c)}return t}function wu(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=Pr(t);hu.has(n??"")&&("extended-attribute"===n&&(s=`[${s}]`),s=`${s}`);const i=ku.has(t)?"type":vu.get(n??"");i&&(s+=` ${i}`);if(r){let e=r;/\s/.test(r)||(e=`${e}`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return sr` -
${{html:n}}
-
`}const yu=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),wu=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function vu(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var ku=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void hs("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=lu,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(sr`${uu.heading}
`);const n=sr`
- ${uu.headingLocal}
+ `}const vu=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),ku=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function $u(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var xu=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void hs("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=du,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(sr`${pu.heading}
`);const n=sr`
+ ${pu.headingLocal}
${function(){const e=function(){const e=new Map,t=document.querySelectorAll("dfn:not([data-cite])");for(const n of t){if(!n.id)continue;const t=Nr(n.textContent),r=e.get(t)||e.set(t,[]).get(t);r?.push(n)}const n=[...e].sort((([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/)))));return n}();return sr`
${e.map((([e,t])=>function(e,t){const n=(e,t,n="")=>{const r=`#${e.id}`;return sr`-
${{html:t}} ${n?{html:n}:""}
-
`};if(1===t.length){const r=t[0],s=pu(r),i=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(du.has(t)||e.dataset.idl||e.closest("code"))&&(r=`${r}`);return r}(r,s,e),o=fu(r,s,e);return n(r,i,o)}return sr`-
+
`};if(1===t.length){const r=t[0],s=fu(r),i=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(hu.has(t)||e.dataset.idl||e.closest("code"))&&(r=`${r}`);return r}(r,s,e),o=gu(r,s,e);return n(r,i,o)}return sr`-
${e}
- ${t.map((t=>{const r=fu(t,pu(t),e)||uu.dfnOf;return n(t,r)}))}
+ ${t.map((t=>{const r=gu(t,fu(t),e)||pu.dfnOf;return n(t,r)}))}
`}(e,t)))}
`}()}
`;e.append(n);const r=sr`
- ${uu.headingExternal}
- ${function(){const e=[...gu().entries()].sort((([e],[t])=>e.localeCompare(t))),t=document.querySelector("section#index"),n=!!t?.classList.contains("prefer-full-spec-title");return sr`
+ ${pu.headingExternal}
+ ${function(){const e=[...yu().entries()].sort((([e],[t])=>e.localeCompare(t))),t=document.querySelector("section#index"),n=!!t?.classList.contains("prefer-full-spec-title");return sr`
${e.map((([e,t])=>{let r;return r=n&&ma[e]?.title?Aa(e,ma[e].title):Aa(e),sr`-
- ${r} ${uu.definesFollowing}
+ ${r} ${pu.definesFollowing}
- ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(bu)}
+ ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(wu)}
`}))}
`}()}
-
`;e.append(r);for(const e of r.querySelectorAll(".index-term"))Fr(e,"index-term");hs("toc",mu,{once:!0}),hs("beforesave",vu)}});const $u="core/contrib";var xu=Object.freeze({__proto__:null,name:$u,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void ns(ls`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,$u)}const t=(e.editors??[]).map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await s();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void sr(t)`${n.map((({name:e,login:t})=>`- ${e||t}
`))}`;const r=n.map((e=>e.name||e.login));t.textContent=Lr(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await zr(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 ns("Error loading contributors from GitHub.",$u,{cause:e}),null}}}(t,n)}});var Cu=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);Hr(e,`h${t}`)}))}});var Su=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map((e=>`h${e}:first-child`)).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter((e=>!e.closest(Cr)));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map((e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),e.appendChild(r),Vr(r,document.createElement("code")),al(r)}});function _u(e,t){const n=document.createElement("pre");n.classList.add("cddl","def","highlight"),t&&(n.id=t);const r=document.createElement("code");return e.map((e=>{const t=document.createDocumentFragment();return e.childNodes.forEach((e=>t.appendChild(e.cloneNode(!0)))),t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),r.querySelectorAll("dfn").forEach((e=>{const t=Hr(e,"span");t.removeAttribute("data-export");for(const e of[...t.attributes])e.name.startsWith("data-dfn")&&t.removeAttribute(e.name)})),n.append(r),n}var Tu=Object.freeze({__proto__:null,name:"core/cddl-index",run:function(){const e=document.querySelector("section#cddl-index");if(!e)return;if(!e.querySelector(":scope > :is(h2, h3, h4, h5, h6):first-child")){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="CDDL Index",e.prepend(t)}const t=Array.from(document.querySelectorAll("pre.cddl:not(.exclude) > code")).filter((e=>!e.closest(Cr)));if(0===t.length){const t="This specification doesn't normatively declare any CDDL.";return void e.append(t)}const n=new Map;for(const e of t){const t=e.closest("pre"),r=t?.dataset.cddlModule||"";let s=n.get(r);s||(s=[],n.set(r,s)),s.push(e)}n.size>1||1===n.size&&!n.has("")?n.forEach(((t,n)=>{const r=document.createElement("section"),s=document.createElement("h3"),i=n||"Default";s.textContent=`Module: ${i}`,n&&(s.id=`cddl-index-module-${n.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`),r.append(s),r.append(_u(t)),e.append(r)})):e.append(_u(t,"actual-cddl-index"))}});const Ru=["h2","h3","h4","h5","h6"],Eu="core/structure",Lu=Ir({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 Au(e,t,{prefix:n=""}={}){let r=!1,s=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=sr`
`;for(const a of e){!a.isAppendix||n||r||(s=i,r=!0);let e=a.isIntro?"":r?Pu(i-s+1):n+i;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(sr`${e} `)),c<=t){const n=a.header.id||a.element.id,r=Iu(a.header,n),s=Au(a.subsections,t,{prefix:e});s&&r.append(s),o.append(r)}}return o}function Pu(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Nu(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(!Ru.includes(r.localName))continue;const s=r.textContent;Fr(e,void 0,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Nu(e)})}return n}function Iu(e,t){const n=sr``;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Hr(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Hr(e,"span").removeAttribute("id")})),sr`- ${n}
`}var Du=Object.freeze({__proto__:null,name:Eu,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&&Hr(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)){ns("`data-max-toc` must have a value between 0-6 (inclusive).",Eu,{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=Au(Nu(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=sr``,n=sr`${Lu.toc}
`;Fr(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const s=sr``;document.body.append(s)}(t)}ps("toc",void 0)}});const Ou=Ir({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 ju=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(sr`${Ou.informative}
`)}))}});const zu=Ir({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Nr(t.textContent)}`),n}}});var Mu=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||(Fr(n),t=n.parentElement?.id||n.id),!e.addSectionLinks)continue;const r=zu.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=sr``;n.replaceWith(s);const i=sr``;e.append(r);for(const e of r.querySelectorAll(".index-term"))Fr(e,"index-term");hs("toc",bu,{once:!0}),hs("beforesave",$u)}});const Cu="core/contrib";var Su=Object.freeze({__proto__:null,name:Cu,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void ns(ls`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Cu)}const t=(e.editors??[]).map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await s();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void sr(t)`${n.map((({name:e,login:t})=>`- ${e||t}
`))}`;const r=n.map((e=>e.name||e.login));t.textContent=Lr(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await zr(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 ns("Error loading contributors from GitHub.",Cu,{cause:e}),null}}}(t,n)}});var _u=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);Hr(e,`h${t}`)}))}});var Tu=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map((e=>`h${e}:first-child`)).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter((e=>!e.closest(Cr)));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map((e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),e.appendChild(r),Vr(r,document.createElement("code")),al(r)}});function Ru(e,t){const n=document.createElement("pre");n.classList.add("cddl","def","highlight"),t&&(n.id=t);const r=document.createElement("code");return e.map((e=>{const t=document.createDocumentFragment();return e.childNodes.forEach((e=>t.appendChild(e.cloneNode(!0)))),t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),r.querySelectorAll("dfn").forEach((e=>{const t=Hr(e,"span");t.removeAttribute("data-export");for(const e of[...t.attributes])e.name.startsWith("data-dfn")&&t.removeAttribute(e.name)})),n.append(r),n}var Eu=Object.freeze({__proto__:null,name:"core/cddl-index",run:function(){const e=document.querySelector("section#cddl-index");if(!e)return;if(!e.querySelector(":scope > :is(h2, h3, h4, h5, h6):first-child")){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="CDDL Index",e.prepend(t)}const t=Array.from(document.querySelectorAll("pre.cddl:not(.exclude) > code")).filter((e=>!e.closest(Cr)));if(0===t.length){const t="This specification doesn't normatively declare any CDDL.";return void e.append(t)}const n=new Map;for(const e of t){const t=e.closest("pre"),r=t?.dataset.cddlModule||"";let s=n.get(r);s||(s=[],n.set(r,s)),s.push(e)}n.size>1||1===n.size&&!n.has("")?n.forEach(((t,n)=>{const r=document.createElement("section"),s=document.createElement("h3"),i=n||"Default";s.textContent=`Module: ${i}`,n&&(s.id=`cddl-index-module-${n.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`),r.append(s),r.append(Ru(t)),e.append(r)})):e.append(Ru(t,"actual-cddl-index"))}});const Lu=["h2","h3","h4","h5","h6"],Au="core/structure",Pu=Ir({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 Nu(e,t,{prefix:n=""}={}){let r=!1,s=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=sr`
`;for(const a of e){!a.isAppendix||n||r||(s=i,r=!0);let e=a.isIntro?"":r?Iu(i-s+1):n+i;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(sr`${e} `)),c<=t){const n=a.header.id||a.element.id,r=Ou(a.header,n),s=Nu(a.subsections,t,{prefix:e});s&&r.append(s),o.append(r)}}return o}function Iu(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Du(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(!Lu.includes(r.localName))continue;const s=r.textContent;Fr(e,void 0,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Du(e)})}return n}function Ou(e,t){const n=sr``;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Hr(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Hr(e,"span").removeAttribute("id")})),sr`- ${n}
`}var ju=Object.freeze({__proto__:null,name:Au,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&&Hr(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)){ns("`data-max-toc` must have a value between 0-6 (inclusive).",Au,{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=Nu(Du(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=sr``,n=sr`${Pu.toc}
`;Fr(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const s=sr``;document.body.append(s)}(t)}ps("toc",void 0)}});const zu=Ir({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 Mu=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(sr`${zu.informative}
`)}))}});const Uu=Ir({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Nr(t.textContent)}`),n}}});var qu=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||(Fr(n),t=n.parentElement?.id||n.id),!e.addSectionLinks)continue;const r=Uu.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=sr``;n.replaceWith(s);const i=sr``;s.append(n,i)}}});var Uu=String.raw`.caniuse-stats{display:flex;column-gap:2em}
+ >
`;s.append(n,i)}}});var Wu=String.raw`.caniuse-stats{display:flex;column-gap:2em}
.caniuse-group{display:flex;flex:1;flex-direction:column;justify-content:flex-end;flex-basis:auto}
.caniuse-browsers{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;margin-top:.2em;column-gap:.4em;border-bottom:1px solid #ccc;row-gap:.4em;padding-bottom:.4cm}
.caniuse-type{align-self:center;border-top:none;text-transform:capitalize;font-size:.8em;margin-top:-.8em;font-weight:700}
@@ -1132,12 +1138,12 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
.caniuse-cell.y::before{content:"✔️";padding:.5em}
.caniuse-cell.n::before{content:"❌";padding:.5em}
.caniuse-cell:is(.a,.d,.p,.x,.u)::before{content:"⚠️";padding:.5em}
-}`;const qu="core/caniuse",Wu="https://respec.org/caniuse/",Fu=new Map([["and_chr",{name:"Android Chrome",path:"chrome",type:"mobile"}],["and_ff",{name:"Android Firefox",path:"firefox",type:"mobile"}],["and_uc",{name:"Android UC",path:"uc",type:"mobile"}],["chrome",{name:"Chrome",type:"desktop"}],["edge",{name:"Edge",type:"desktop"}],["firefox",{name:"Firefox",type:"desktop"}],["ios_saf",{name:"iOS Safari",path:"safari-ios",type:"mobile"}],["op_mob",{name:"Opera Mobile",path:"opera",type:"mobile"}],["opera",{name:"Opera",type:"desktop"}],["safari",{name:"Safari",type:"desktop"}],["samsung",{name:"Samsung Internet",path:"samsung-internet",type:"mobile"}]]),Bu=new Map([["a","almost supported (aka Partial support)"],["d","disabled by default"],["n","no support, or disabled by default"],["p","no support, but has Polyfill"],["u","unknown support"],["x","requires prefix to work"],["y","supported by default"]]);var Hu=Object.freeze({__proto__:null,BROWSERS:Fu,name:qu,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(Fu.keys());t.delete("op_mob"),t.delete("opera");const n={removeOnSave:!0,browsers:[...t]};if("string"==typeof e.caniuse)return void(e.caniuse={feature:e.caniuse,...n});e.caniuse={...n,...e.caniuse}}(e),function({caniuse:e}){const{browsers:t}=e,n=t.filter((e=>!Fu.has(e)));if(n.length){rs(ls`Invalid browser(s): (${as(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,qu)}}(e);const t=e.caniuse;t.feature&&document.head.appendChild(sr``)},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,r=document.querySelector(".head dl"),s=async function(e){const{feature:t,browsers:n,apiURL:r}=e,s=new URL(r||`./${t}`,Wu);n.forEach((e=>s.searchParams.append("browsers",e)));const i=await fetch(s);if(!i.ok){const{status:e,statusText:t}=i;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return i.json()}(e.caniuse).then((e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),s=function(e){return(t,{browser:n,version:r,caniuse:s})=>{const i=Fu.get(n),{name:o,type:a}=i??{name:n,type:"desktop"},c=Bu.get(s),l=r||"—",u=r?` version ${r}`:" (version unknown)",d=`${e} is ${c} since ${o}${u} on ${a}.`,p=`caniuse-cell ${s}`,h=(f=`${c} since ${o}${u}.`).charAt(0).toUpperCase()+f.slice(1);var f;const m=function(e){const t=Fu.get(e)?.path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),g=sr`
+ ${Wu}
+ `)},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,r=document.querySelector(".head dl"),s=async function(e){const{feature:t,browsers:n,apiURL:r}=e,s=new URL(r||`./${t}`,Bu);n.forEach((e=>s.searchParams.append("browsers",e)));const i=await fetch(s);if(!i.ok){const{status:e,statusText:t}=i;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return i.json()}(e.caniuse).then((e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),s=function(e){return(t,{browser:n,version:r,caniuse:s})=>{const i=Hu.get(n),{name:o,type:a}=i??{name:n,type:"desktop"},c=Gu.get(s),l=r||"—",u=r?` version ${r}`:" (version unknown)",d=`${e} is ${c} since ${o}${u} on ${a}.`,p=`caniuse-cell ${s}`,h=(f=`${c} since ${o}${u}.`).charAt(0).toUpperCase()+f.slice(1);var f;const m=function(e){const t=Hu.get(e)?.path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),g=sr`
${e}
`));return i.push(sr`More info`),i}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=ls`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return ns(r,qu,{hint:s,cause:e}),sr`caniuse.com`}(e,t,n))),i=sr`Browser support:
+ >`),i}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=ls`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return ns(r,Fu,{hint:s,cause:e}),sr`caniuse.com`}(e,t,n))),i=sr`Browser support:
${{any:s,placeholder:"Fetching data from caniuse.com..."}}
`;r?.append(...i.childNodes),await s,ps("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r?.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),hs("beforesave",(e=>{sr.bind(e.querySelector(".caniuse-stats"))`
- caniuse.com`})))}});var Gu=String.raw`.baseline-title{display:flex;align-items:center;gap:.4em}
+ caniuse.com`})))}});var Ju=String.raw`.baseline-title{display:flex;align-items:center;gap:.4em}
.baseline-icon{width:auto;height:.9em;vertical-align:baseline}
.baseline-status{display:flex;align-items:center;gap:1em}
.baseline-browsers{display:flex;gap:.5em;align-items:center}
@@ -1183,7 +1189,7 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
@media print{
.baseline-pill{background:0 0!important;border:1px solid #ccc}
.baseline-support-icon{color:#333!important}
-}`;const Vu="core/implementation-status",Ju="https://respec.org/api/baseline",Ku="https://respec.org/api/baseline/search",Zu="https://www.w3.org/assets/logos/browser-logos",Yu=new Map([["chrome",{name:"Chrome",engine:"chromium"}],["edge",{name:"Edge",engine:"chromium"}],["firefox",{name:"Firefox",engine:"gecko"}],["safari",{name:"Safari",engine:"webkit"}]]),Xu=new Map([["high","Widely available"],["low","Newly available"],["","Limited availability"]]),Qu=new Map([["",()=>sr``;return{dt:u,dd:d,moreInfoUrl:c}}(r,s,i,n)}(e,t).catch(rd),s=r.then((e=>e.dt)),i=r.then((e=>e.dd)),o=sr`
+ >`;return{dt:u,dd:d,moreInfoUrl:c}}(r,s,i,n)}(e,t).catch(id),s=r.then((e=>e.dt)),i=r.then((e=>e.dd)),o=sr`
${{any:s,placeholder:"Implementation status:"}}
${{any:i,placeholder:"Checking availability..."}}
- `;n.append(...o.childNodes);const a=await r;if(t.removeOnSave){const e=a.moreInfoUrl||"https://webstatus.dev/";hs("beforesave",(t=>{const n=t.querySelector(".baseline-status");n&&sr.bind(n)`Web Platform Status`}))}}});var ud=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem}
+ ${md.inAllEngines}
`;if(e.length<2)return sr`${md.inSomeEngines}
`}(i)} + ${function(e){if(3===e.length)return sr`${bd.inAllEngines}
`;if(e.length<2)return sr`${bd.inSomeEngines}
`}(i)} ${s?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,s=`${e} ${t.toLowerCase()}`;return sr`No support data.
`} - `}var yd=Object.freeze({__proto__:null,name:dd,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return!0===n?t:"string"==typeof n?n:n.key||t}(e);if(!t)return;const n="object"==typeof e.mdn?e.mdn:{},r=await async function(e,t){const{baseJsonPath:n=pd,maxAge:r=864e5}=t,s=new URL(`${e}.json`,n).href,i=await zr(s,r);return 404===i.status?null:await i.json()}(t,n);if(!r){const n=`Could not find MDN data associated with key "${t}".`,r=!0===e.mdn?ls`When using \`mdn: true\`, the key defaults to ${"[shortName]"} ("${t}"). Check that your shortName matches an entry in the [MDN spec links map](https://github.com/w3c/mdn-spec-links/blob/main/SPECMAP.json), or set ${"[mdn]"} to the correct key.`:ls`Search for your spec's URL in the [MDN spec links map](https://github.com/w3c/mdn-spec-links/blob/main/SPECMAP.json) to find the correct key, then set ${"[mdn]"} to it.`;return void ns(n,dd,{hint:r})}const s=document.createElement("style");s.textContent=ud,document.head.append(s);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter((({id:t})=>Array.isArray(e[t])))}(r)){const t=r[e.id],n=gd(e);if(n)for(const e of t)n.append(bd(e))}}});const wd="ui/save-html",vd=Ir({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),kd=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return gs(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return gs(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];var $d=Object.freeze({__proto__:null,exportDocument:function(e,t){return rs("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",wd,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),gs(t)},name:wd,run:function(e){const t={async show(t){await document.respec.ready;const n=sr``;ni.freshModal($d.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=ni.addCommand($d.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Sd="https://respec.org/specref/",_d=Ir({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"},cs:{search_specref:"Hledat ve Specref"}}),Td=ni.addCommand(_d.search_specref,(function(){const e=sr` + + Open Search UI in a new tab + `;ni.freshModal(_d.search_specref,e,Td)}),"Ctrl+Shift+Alt+space","🔎");var Rd=Object.freeze({__proto__:null});const Ed="https://respec.org/xref/",Ld=Ir({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"},cs:{title:"Hledat definice"}}),Ad=ni.addCommand(Ld.title,(function(){const e=sr` + + Open Search UI in a new tab + `;ni.freshModal(Ld.title,e,Ad)}),"Ctrl+Shift+Alt+x","📚");var Pd=Object.freeze({__proto__:null});const Nd=Ir({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 Id=document.createElement("div"),Dd=sr.bind(Id),Od=ni.addCommand(`${Nd.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(jd).forEach((t=>{e.push(t)}));Dd`ReSpec is a document production toolchain, with a notable focus on W3C specifications.
@@ -1337,19 +1343,19 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0} ${e}${o}`,t.classList.length||t.removeAttribute("class");break;case"code":t.innerHTML=o,t.classList.add("hljs"),i&&t.classList.add(i)}t.setAttribute("aria-busy","false")}var Jd=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(Vd);document.head.appendChild(sr``),await Promise.all(n)}});const Kd=Ir({en:{missing_test_suite_uri:ls`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:ls`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:ls`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:ls`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),Zd="core/data-tests";function Yd(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[s]=r;if(r.find((e=>"https"===e))){const e=document.createElement("span");e.textContent="🔒",e.setAttribute("aria-label","requires a secure connection"),e.setAttribute("title","Test requires HTTPS"),s=s.replace(".https",""),t.push(e)}if(s.split(".").join("-").split("-").find((e=>"manual"===e))){const e=document.createElement("span");e.textContent="💪",e.setAttribute("aria-label","the test must be run manually"),e.setAttribute("title","Manual test"),s=s.replace("-manual",""),t.push(e)}return sr`
+.hljs-link{text-decoration:underline}`;const Jd=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Kd(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 s;try{s=await async function(e,t){const n={action:"highlight",code:e,id:Jd(),languages:t},r=await xs;return r.postMessage(n),new Promise(((e,t)=>{const s=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(i){const{data:{id:o,language:a,value:c}}=i;o===n.id&&(r.removeEventListener("message",t),clearTimeout(s),e({language:a,value:c}))}))}))}(t.innerText,n)}catch(e){return void console.error(e)}const{language:i,value:o}=s;switch(t.localName){case"pre":t.classList.remove(i),t.innerHTML=`${o}`,t.classList.length||t.removeAttribute("class");break;case"code":t.innerHTML=o,t.classList.add("hljs"),i&&t.classList.add(i)}t.setAttribute("aria-busy","false")}var Zd=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(Kd);document.head.appendChild(sr``),await Promise.all(n)}});const Yd=Ir({en:{missing_test_suite_uri:ls`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:ls`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:ls`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:ls`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),Xd="core/data-tests";function Qd(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[s]=r;if(r.find((e=>"https"===e))){const e=document.createElement("span");e.textContent="🔒",e.setAttribute("aria-label","requires a secure connection"),e.setAttribute("title","Test requires HTTPS"),s=s.replace(".https",""),t.push(e)}if(s.split(".").join("-").split("-").find((e=>"manual"===e))){const e=document.createElement("span");e.textContent="💪",e.setAttribute("aria-label","the test must be run manually"),e.setAttribute("title","Manual test"),s=s.replace("-manual",""),t.push(e)}return sr`